Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

JIN223
/
gpt2_imdb

Text Generation
KerasHub
Model card Files Files and versions
xet
Community

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

  • Libraries
  • KerasHub

    How to use JIN223/gpt2_imdb with KerasHub:

    import keras_hub
    
    # Load CausalLM model (optional: use half precision for inference)
    causal_lm = keras_hub.models.CausalLM.from_preset("hf://JIN223/gpt2_imdb", dtype="bfloat16")
    causal_lm.compile(sampler="greedy")  # (optional) specify a sampler
    
    # Generate text
    causal_lm.generate("Keras: deep learning for", max_length=64)
    
    import keras_hub
    
    # Create a Backbone model unspecialized for any task
    backbone = keras_hub.models.Backbone.from_preset("hf://JIN223/gpt2_imdb")
    
  • Keras

    How to use JIN223/gpt2_imdb with Keras:

    # Available backend options are: "jax", "torch", "tensorflow".
    import os
    os.environ["KERAS_BACKEND"] = "jax"
    
    import keras
    
    model = keras.saving.load_model("hf://JIN223/gpt2_imdb")
    
  • Notebooks
  • Google Colab
  • Kaggle
gpt2_imdb
500 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 2 commits
JIN223's picture
JIN223
Upload folder using huggingface_hub
ef33f6b verified about 1 year ago
  • assets
    Upload folder using huggingface_hub about 1 year ago
  • .gitattributes
    1.52 kB
    initial commit about 1 year ago
  • README.md
    700 Bytes
    Upload folder using huggingface_hub about 1 year ago
  • config.json
    431 Bytes
    Upload folder using huggingface_hub about 1 year ago
  • metadata.json
    183 Bytes
    Upload folder using huggingface_hub about 1 year ago
  • model.weights.h5
    498 MB
    xet
    Upload folder using huggingface_hub about 1 year ago
  • preprocessor.json
    1.45 kB
    Upload folder using huggingface_hub about 1 year ago
  • task.json
    2.59 kB
    Upload folder using huggingface_hub about 1 year ago
  • tokenizer.json
    618 Bytes
    Upload folder using huggingface_hub about 1 year ago