Run this model with HF Jobs
Run keras/roberta_base_en on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/keras/roberta_base_en. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/keras/roberta_base_en on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use keras/roberta_base_en with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/roberta_base_en with KerasHub:
import keras_hub # Load TextClassifier model text_classifier = keras_hub.models.TextClassifier.from_preset( "hf://keras/roberta_base_en", 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/roberta_base_en")import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://keras/roberta_base_en") - Keras
How to use keras/roberta_base_en 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/roberta_base_en") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse filesFiles changed (7)
- README.mdAdded+16
- assets/tokenizer/merges.txtAdded
- assets/tokenizer/vocabulary.jsonAdded
- config.jsonAdded+18
- metadata.jsonAdded+6
- model.weights.h5Added+3
- tokenizer.jsonAdded+17
12345678910111213141516---library_name: keras-hub---This is a [`Roberta` model](https://keras.io/api/keras_hub/models/roberta) uploaded using the KerasHub library and can be used with JAX, TensorFlow, and PyTorch backends.Model config:* **name:** roberta_backbone* **trainable:** True* **vocabulary_size:** 50265* **num_layers:** 12* **num_heads:** 12* **hidden_dim:** 768* **intermediate_dim:** 3072* **dropout:** 0.1* **max_sequence_length:** 512
This model card has been generated automatically and should be completed by the model author. See [Model Cards documentation](https://huggingface.co/docs/hub/model-cards) for more information.123456789101112131415161718{ "module": "keras_nlp.src.models.roberta.roberta_backbone", "class_name": "RobertaBackbone", "config": { "name": "roberta_backbone", "trainable": true, "vocabulary_size": 50265, "num_layers": 12, "num_heads": 12, "hidden_dim": 768, "intermediate_dim": 3072, "dropout": 0.1, "max_sequence_length": 512 }, "registered_name": "keras_nlp>RobertaBackbone", "assets": [], "weights": "model.weights.h5"}123456{ "keras_version": "3.0.1", "keras_nlp_version": "0.7.0", "parameter_count": 124052736, "date_saved": "2023-12-27@02:26:30"}123version https://git-lfs.github.com/spec/v1oid sha256:b4277aaf3bea6416f5bf1a2b81eb42b663a8da0383d6a65844be6b1edab7a703size 4966115841234567891011121314151617{ "module": "keras_nlp.src.models.roberta.roberta_tokenizer", "class_name": "RobertaTokenizer", "config": { "name": "roberta_tokenizer", "trainable": true, "dtype": "int32", "sequence_length": null, "add_prefix_space": false }, "registered_name": "keras_nlp>RobertaTokenizer", "assets": [ "assets/tokenizer/merges.txt", "assets/tokenizer/vocabulary.json" ], "weights": null}README.mdAdded+16
assets/tokenizer/merges.txtAdded
assets/tokenizer/vocabulary.jsonAdded
config.jsonAdded+18
metadata.jsonAdded+6
model.weights.h5Added+3
tokenizer.jsonAdded+17