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

  • Log In
  • Sign Up

cahya
/
gpt2-medium-indonesian

Text Generation
Transformers
PyTorch
google-tensorflow TensorFlow
JAX
TensorBoard
gpt2
text-generation-inference
Model card Files Files and versions
xet
Metrics Training metrics Community
1

Instructions to use cahya/gpt2-medium-indonesian with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use cahya/gpt2-medium-indonesian with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="cahya/gpt2-medium-indonesian")
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained("cahya/gpt2-medium-indonesian")
    model = AutoModelForCausalLM.from_pretrained("cahya/gpt2-medium-indonesian")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps Settings
  • vLLM

    How to use cahya/gpt2-medium-indonesian with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "cahya/gpt2-medium-indonesian"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "cahya/gpt2-medium-indonesian",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
    Use Docker
    docker model run hf.co/cahya/gpt2-medium-indonesian
  • SGLang

    How to use cahya/gpt2-medium-indonesian with SGLang:

    Install from pip and serve model
    # Install SGLang from pip:
    pip install sglang
    # Start the SGLang server:
    python3 -m sglang.launch_server \
        --model-path "cahya/gpt2-medium-indonesian" \
        --host 0.0.0.0 \
        --port 30000
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:30000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "cahya/gpt2-medium-indonesian",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
    Use Docker images
    docker run --gpus all \
        --shm-size 32g \
        -p 30000:30000 \
        -v ~/.cache/huggingface:/root/.cache/huggingface \
        --env "HF_TOKEN=<secret>" \
        --ipc=host \
        lmsysorg/sglang:latest \
        python3 -m sglang.launch_server \
            --model-path "cahya/gpt2-medium-indonesian" \
            --host 0.0.0.0 \
            --port 30000
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:30000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "cahya/gpt2-medium-indonesian",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use cahya/gpt2-medium-indonesian with Docker Model Runner:

    docker model run hf.co/cahya/gpt2-medium-indonesian
gpt2-medium-indonesian
4.65 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 9 commits
cahya's picture
cahya
add tensorflow version
e07e76a over 3 years ago
  • .gitattributes
    1.48 kB
    initial commit over 3 years ago
  • config.json
    1.02 kB
    add tensorflow version over 3 years ago
  • events.out.tfevents.1673448691.t1v-n-5e821bbf-w-0.3099762.0.v2
    32.4 MB
    xet
    add event* over 3 years ago
  • events.out.tfevents.1673734087.t1v-n-5e821bbf-w-0.15892.0.v2
    327 MB
    xet
    add event* over 3 years ago
  • flax_model.msgpack
    1.42 GB
    xet
    epoch 3.7 over 3 years ago
  • merges.txt
    467 kB
    add first model over 3 years ago
  • pytorch_model.bin

    Detected Pickle imports (4)

    • "torch.ByteStorage",
    • "torch.FloatStorage",
    • "collections.OrderedDict",
    • "torch._utils._rebuild_tensor_v2"

    What is a pickle import?

    1.44 GB
    xet
    epoch 3.7 over 3 years ago
  • special_tokens_map.json
    99 Bytes
    add first model over 3 years ago
  • tf_model.h5
    1.42 GB
    xet
    add tensorflow version over 3 years ago
  • tokenizer.json
    2.13 MB
    add first model over 3 years ago
  • tokenizer_config.json
    254 Bytes
    add first model over 3 years ago
  • vocab.json
    808 kB
    add first model over 3 years ago