Instructions to use zeromodels/bart_base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/bart_base with ZeroModels:
# pip install -U zeromodels # ZeroModels is pure Keras 3, so pick a backend: "jax", "torch" or "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" from zeromodels import AutoZModel # AutoZModel reads the repo's model_type and loads the matching class. # For a task head use the matching loader, e.g. AutoZMImageClassify / AutoZMDetect / # AutoZMSemanticSegment / AutoZMTextGenerate (see zeromodels.auto). model = AutoZModel.from_weights("zeromodels/bart_base") - Keras
How to use zeromodels/bart_base 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://zeromodels/bart_base") - Notebooks
- Google Colab
- Kaggle
File size: 886 Bytes
fb99dd0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | {
"library_name": "zeromodels",
"zeromodels_version": "1.3.0",
"model_module": "zeromodels.models.bart",
"model_class": "BartConditionalGenerate",
"variant": "bart_base",
"weights": "model.weights.h5",
"schema_version": 2,
"model_type": "bart",
"text_config": {
"vocab_size": 50265,
"hidden_dim": 768,
"encoder_num_layers": 6,
"decoder_num_layers": 6,
"encoder_attention_heads": 12,
"decoder_attention_heads": 12,
"encoder_ffn_dim": 3072,
"decoder_ffn_dim": 3072,
"max_position_embeddings": 1024,
"activation_function": "gelu",
"scale_embedding": false,
"layer_norm_eps": 1e-05,
"classifier_dropout": 0.0,
"num_labels": 3,
"pad_token_id": 1,
"bos_token_id": 0,
"eos_token_id": 2,
"decoder_start_token_id": 2
},
"generate_args": {
"max_new_tokens": 64
}
} |