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

  • Log In
  • Sign Up

JuwonOh
/
gpt2_mitre

Text Generation
Transformers
PyTorch
gpt2
Generated from Trainer
text-generation-inference
Model card Files Files and versions
xet
Community
1

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

  • Libraries
  • Transformers

    How to use JuwonOh/gpt2_mitre with Transformers:

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

    How to use JuwonOh/gpt2_mitre with vLLM:

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

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

    How to use JuwonOh/gpt2_mitre with Docker Model Runner:

    docker model run hf.co/JuwonOh/gpt2_mitre
gpt2_mitre
513 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 6 commits
JuwonOh's picture
JuwonOh
update model card README.md
23c0bf2 about 3 years ago
  • .gitattributes
    1.48 kB
    initial commit about 3 years ago
  • .gitignore
    13 Bytes
    Model save about 3 years ago
  • README.md
    1.35 kB
    update model card README.md about 3 years ago
  • config.json
    898 Bytes
    Model save about 3 years ago
  • generation_config.json
    111 Bytes
    Model save about 3 years ago
  • merges.txt
    448 kB
    Model save about 3 years ago
  • pytorch_model.bin
    510 MB
    xet
    Model save about 3 years ago
  • special_tokens_map.json
    131 Bytes
    Model save about 3 years ago
  • tokenizer.json
    2.09 MB
    Model save about 3 years ago
  • tokenizer_config.json
    295 Bytes
    Model save about 3 years ago
  • training_args.bin
    3.44 kB
    xet
    Training in progress, step 5000 about 3 years ago
  • vocab.json
    789 kB
    Model save about 3 years ago