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

  • Log In
  • Sign Up

ShengweiPeng
/
MiniMind2-Small-Traditional-Chinese

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

Instructions to use ShengweiPeng/MiniMind2-Small-Traditional-Chinese with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use ShengweiPeng/MiniMind2-Small-Traditional-Chinese with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="ShengweiPeng/MiniMind2-Small-Traditional-Chinese", trust_remote_code=True)
    messages = [
        {"role": "user", "content": "Who are you?"},
    ]
    pipe(messages)
    # Load model directly
    from transformers import AutoModelForCausalLM
    model = AutoModelForCausalLM.from_pretrained("ShengweiPeng/MiniMind2-Small-Traditional-Chinese", trust_remote_code=True, dtype="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use ShengweiPeng/MiniMind2-Small-Traditional-Chinese with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "ShengweiPeng/MiniMind2-Small-Traditional-Chinese"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "ShengweiPeng/MiniMind2-Small-Traditional-Chinese",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
    Use Docker
    docker model run hf.co/ShengweiPeng/MiniMind2-Small-Traditional-Chinese
  • SGLang

    How to use ShengweiPeng/MiniMind2-Small-Traditional-Chinese 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 "ShengweiPeng/MiniMind2-Small-Traditional-Chinese" \
        --host 0.0.0.0 \
        --port 30000
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:30000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "ShengweiPeng/MiniMind2-Small-Traditional-Chinese",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
    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 "ShengweiPeng/MiniMind2-Small-Traditional-Chinese" \
            --host 0.0.0.0 \
            --port 30000
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:30000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "ShengweiPeng/MiniMind2-Small-Traditional-Chinese",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
  • Docker Model Runner

    How to use ShengweiPeng/MiniMind2-Small-Traditional-Chinese with Docker Model Runner:

    docker model run hf.co/ShengweiPeng/MiniMind2-Small-Traditional-Chinese
MiniMind2-Small-Traditional-Chinese
52.2 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 3 commits
ShengweiPeng's picture
ShengweiPeng
Upload tokenizer
4cacc44 verified 12 months ago
  • .gitattributes
    1.52 kB
    initial commit 12 months ago
  • README.md
    5.17 kB
    Upload MiniMindForCausalLM 12 months ago
  • config.json
    831 Bytes
    Upload MiniMindForCausalLM 12 months ago
  • generation_config.json
    111 Bytes
    Upload MiniMindForCausalLM 12 months ago
  • model_minimind.py
    20.6 kB
    Upload MiniMindForCausalLM 12 months ago
  • pytorch_model.bin

    Detected Pickle imports (3)

    • "torch._utils._rebuild_tensor_v2",
    • "torch.BFloat16Storage",
    • "collections.OrderedDict"

    What is a pickle import?

    51.7 MB
    xet
    Upload MiniMindForCausalLM 12 months ago
  • special_tokens_map.json
    583 Bytes
    Upload tokenizer 12 months ago
  • tokenizer.json
    440 kB
    Upload tokenizer 12 months ago
  • tokenizer_config.json
    1.58 kB
    Upload tokenizer 12 months ago