Instructions to use keras/bert_tiny_en_uncased_sst2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/bert_tiny_en_uncased_sst2 with KerasHub:
import keras_hub # Load TextClassifier model text_classifier = keras_hub.models.TextClassifier.from_preset( "hf://keras/bert_tiny_en_uncased_sst2", num_classes=2, ) # Fine-tune text_classifier.fit(x=["Thilling adventure!", "Total snoozefest."], y=[1, 0]) # Classify text text_classifier.predict(["Not my cup of tea."])import keras_hub # Create a MaskedLM model task = keras_hub.models.MaskedLM.from_preset("hf://keras/bert_tiny_en_uncased_sst2")import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://keras/bert_tiny_en_uncased_sst2") - Keras
How to use keras/bert_tiny_en_uncased_sst2 with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://keras/bert_tiny_en_uncased_sst2") - Notebooks
- Google Colab
- Kaggle
Download task.weights.h5 from keras/bert_tiny_en_uncased_sst2: direct link, hf CLI and curl.
- Browser
- Download file 52.8 MB
-
https://huggingface.co/keras/bert_tiny_en_uncased_sst2/resolve/main/task.weights.h5
- Command line
-
hf download hf://keras/bert_tiny_en_uncased_sst2/task.weights.h5
-
curl -L -o task.weights.h5 https://huggingface.co/keras/bert_tiny_en_uncased_sst2/resolve/main/task.weights.h5
52.8 MB
- Xet hash:
- a8e4ae443306a6979669fbc38c6de9c2be281dbc2b001df58d1f3aa19f0c78ca
- Size of remote file:
- 52.8 MB
- SHA256:
- 590b2faac564a34b509dea8f16a50d4f3186e84b2f6144a71deaf6ffc70621b5
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.