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

  • Log In
  • Sign Up

imthanhlv
/
vigpt2medium

Text Generation
Transformers
PyTorch
JAX
gpt2
text-generation-inference
Model card Files Files and versions
xet
Community
15

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

  • Libraries
  • Transformers

    How to use imthanhlv/vigpt2medium with Transformers:

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

    How to use imthanhlv/vigpt2medium with vLLM:

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

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

    How to use imthanhlv/vigpt2medium with Docker Model Runner:

    docker model run hf.co/imthanhlv/vigpt2medium
vigpt2medium
Ctrl+K
Ctrl+K
  • 1 contributor
History: 50 commits
imthanhlv's picture
imthanhlv
Update config.json
f63d11e almost 4 years ago
  • .gitattributes
    1.18 kB
    Saving weights and logs of step 50000 over 4 years ago
  • added_tokens.json
    24 Bytes
    Saving weights and logs of step 50000 over 4 years ago
  • config.json
    958 Bytes
    Update config.json almost 4 years ago
  • create_config.py
    183 Bytes
    first commit over 4 years ago
  • flax_model.msgpack
    1.42 GB
    xet
    Saving weights and logs of step 1850000 over 4 years ago
  • flax_to_pt.py
    147 Bytes
    add torch model over 4 years ago
  • merges.txt
    439 kB
    Saving weights and logs of step 50000 over 4 years ago
  • out.txt
    202 kB
    Saving weights and logs of step 50000 over 4 years ago
  • pytorch_model.bin

    Detected Pickle imports (4)

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

    What is a pickle import?

    1.44 GB
    xet
    added lastest pt checkpoint about 4 years ago
  • requirements.txt
    69 Bytes
    first commit over 4 years ago
  • run_clm_flax.py
    33.5 kB
    first commit over 4 years ago
  • special_tokens_map.json
    90 Bytes
    Saving weights and logs of step 50000 over 4 years ago
  • tokenizer.json
    1.32 MB
    Saving weights and logs of step 50000 over 4 years ago
  • tokenizer_config.json
    207 Bytes
    Saving weights and logs of step 50000 over 4 years ago
  • train_tokenizer.py
    636 Bytes
    first commit over 4 years ago
  • vocab.json
    781 kB
    Saving weights and logs of step 50000 over 4 years ago