Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

keras
/
gte_modern_bert_base

KerasHub
Model card Files Files and versions
xet
Community

Instructions to use keras/gte_modern_bert_base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • KerasHub

    How to use keras/gte_modern_bert_base with KerasHub:

    import keras_hub
    
    # Load TextClassifier model
    text_classifier = keras_hub.models.TextClassifier.from_preset(
        "hf://keras/gte_modern_bert_base",
        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/gte_modern_bert_base")
    
    import keras_hub
    
    # Create a TextEmbedder model
    task = keras_hub.models.TextEmbedder.from_preset("hf://keras/gte_modern_bert_base")
    
    import keras_hub
    
    # Create a Backbone model unspecialized for any task
    backbone = keras_hub.models.Backbone.from_preset("hf://keras/gte_modern_bert_base")
    
  • Keras

    How to use keras/gte_modern_bert_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://keras/gte_modern_bert_base")
    
  • Notebooks
  • Google Colab
  • Kaggle
gte_modern_bert_base
598 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 3 commits
laxmareddyp's picture
laxmareddyp
Update README.md with new model card content
cc7f616 verified 1 day ago
  • assets
    Upload folder using huggingface_hub 1 day ago
  • .gitattributes
    1.52 kB
    initial commit 1 day ago
  • README.md
    53 Bytes
    Update README.md with new model card content 1 day ago
  • config.json
    822 Bytes
    Upload folder using huggingface_hub 1 day ago
  • metadata.json
    239 Bytes
    Upload folder using huggingface_hub 1 day ago
  • model.weights.h5
    597 MB
    xet
    Upload folder using huggingface_hub 1 day ago
  • preprocessor.json
    5.47 kB
    Upload folder using huggingface_hub 1 day ago
  • task.json
    8.11 kB
    Upload folder using huggingface_hub 1 day ago
  • tokenizer.json
    3.7 kB
    Upload folder using huggingface_hub 1 day ago