Instructions to use samanehs/test_bert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use samanehs/test_bert with KerasHub:
import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://samanehs/test_bert") - Keras
How to use samanehs/test_bert 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://samanehs/test_bert") - Notebooks
- Google Colab
- Kaggle
Download preprocessor.json from samanehs/test_bert: direct link, hf CLI and curl.
- Browser
- Download file 939 Bytes
-
https://huggingface.co/samanehs/test_bert/resolve/main/preprocessor.json
- Command line
-
hf download hf://samanehs/test_bert/preprocessor.json
-
curl -L -o preprocessor.json https://huggingface.co/samanehs/test_bert/resolve/main/preprocessor.json
939 Bytes
| { | |
| "module": "keras_nlp.models.bert.bert_preprocessor", | |
| "class_name": "BertPreprocessor", | |
| "config": { | |
| "name": "bert_preprocessor", | |
| "trainable": true, | |
| "dtype": "float32", | |
| "tokenizer": { | |
| "module": "keras_nlp.models.bert.bert_tokenizer", | |
| "class_name": "BertTokenizer", | |
| "config": { | |
| "name": "bert_tokenizer", | |
| "trainable": true, | |
| "dtype": "int32", | |
| "vocabulary": null, | |
| "sequence_length": null, | |
| "lowercase": true, | |
| "strip_accents": false, | |
| "split": true, | |
| "suffix_indicator": "##", | |
| "oov_token": "[UNK]" | |
| }, | |
| "registered_name": "keras_nlp>BertTokenizer" | |
| }, | |
| "sequence_length": 512, | |
| "truncate": "round_robin" | |
| }, | |
| "registered_name": "keras_nlp>BertPreprocessor" | |
| } |