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
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

sunzeyeah
/
pangu-2_6B-sft

Text Generation
Transformers
PyTorch
gpt_pangu
custom_code
Model card Files Files and versions
xet
Community
1

Instructions to use sunzeyeah/pangu-2_6B-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use sunzeyeah/pangu-2_6B-sft with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="sunzeyeah/pangu-2_6B-sft", trust_remote_code=True)
    # pip install -U transformers accelerate
    # Load model directly
    from transformers import AutoModelForCausalLM
    model = AutoModelForCausalLM.from_pretrained("sunzeyeah/pangu-2_6B-sft", trust_remote_code=True, device_map="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps Settings
  • vLLM

    How to use sunzeyeah/pangu-2_6B-sft with vLLM:

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

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

    How to use sunzeyeah/pangu-2_6B-sft with Docker Model Runner:

    docker model run hf.co/sunzeyeah/pangu-2_6B-sft
pangu-2_6B-sft
10.9 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 5 commits
sunzeyeah's picture
sunzeyeah
update modeling and tokenization
208cdc0 over 3 years ago
  • .gitattributes
    1.48 kB
    initial commit over 3 years ago
  • README.md
    2.52 kB
    Update README.md over 3 years ago
  • config.json
    1.09 kB
    init over 3 years ago
  • configuration_gptpangu.py
    1.98 kB
    init over 3 years ago
  • generation_config.json
    133 Bytes
    init over 3 years ago
  • modeling_gptpangu.py
    22.2 kB
    update modeling and tokenization over 3 years ago
  • pytorch_model-00001-of-00002.bin
    9.98 GB
    xet
    init over 3 years ago
  • pytorch_model-00002-of-00002.bin
    961 MB
    xet
    init over 3 years ago
  • pytorch_model.bin.index.json
    43.8 kB
    init over 3 years ago
  • tokenization_gptpangu.py
    4.11 kB
    update modeling and tokenization over 3 years ago
  • tokenizer_config.json
    324 Bytes
    init over 3 years ago
  • training_args.bin
    3.57 kB
    xet
    init over 3 years ago
  • vocab.model
    880 kB
    xet
    init over 3 years ago