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

  • Log In
  • Sign Up

OscarNav
/
flan-gpt2-medium-ft

Text Generation
Transformers
Safetensors
gpt2
text-generation-inference
Model card Files Files and versions
xet
Community

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

  • Libraries
  • Transformers

    How to use OscarNav/flan-gpt2-medium-ft with Transformers:

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

    How to use OscarNav/flan-gpt2-medium-ft with vLLM:

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

    How to use OscarNav/flan-gpt2-medium-ft 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 "OscarNav/flan-gpt2-medium-ft" \
        --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": "OscarNav/flan-gpt2-medium-ft",
    		"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 "OscarNav/flan-gpt2-medium-ft" \
            --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": "OscarNav/flan-gpt2-medium-ft",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use OscarNav/flan-gpt2-medium-ft with Docker Model Runner:

    docker model run hf.co/OscarNav/flan-gpt2-medium-ft
flan-gpt2-medium-ft
714 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 4 commits
OscarNav's picture
OscarNav
Uploaded/updated model with loss 1.61990966796875
31c4b27 verified 12 months ago
  • .gitattributes
    1.52 kB
    initial commit about 1 year ago
  • README.md
    5.17 kB
    Uploaded/updated model with loss 2.9466796875 about 1 year ago
  • added_tokens.json
    21 Bytes
    Upload tokenizer about 1 year ago
  • config.json
    1.01 kB
    Uploaded/updated model with loss 1.61990966796875 12 months ago
  • generation_config.json
    119 Bytes
    Uploaded/updated model with loss 2.9466796875 about 1 year ago
  • merges.txt
    456 kB
    Upload tokenizer about 1 year ago
  • model.safetensors
    710 MB
    xet
    Uploaded/updated model with loss 1.61990966796875 12 months ago
  • special_tokens_map.json
    237 Bytes
    Upload tokenizer about 1 year ago
  • tokenizer.json
    3.56 MB
    Upload tokenizer about 1 year ago
  • tokenizer_config.json
    639 Bytes
    Upload tokenizer about 1 year ago
  • vocab.json
    798 kB
    Upload tokenizer about 1 year ago