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

fuwangwang
/
mpt-7b

Text Generation
Transformers
PyTorch
mpt
Composer
MosaicML
llm-foundry
StreamingDatasets
custom_code
text-generation-inference
Model card Files Files and versions
xet
Community
1

Instructions to use fuwangwang/mpt-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use fuwangwang/mpt-7b with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="fuwangwang/mpt-7b", trust_remote_code=True)
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained("fuwangwang/mpt-7b", trust_remote_code=True)
    model = AutoModelForCausalLM.from_pretrained("fuwangwang/mpt-7b", trust_remote_code=True, device_map="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps Settings
  • vLLM

    How to use fuwangwang/mpt-7b with vLLM:

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

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

    How to use fuwangwang/mpt-7b with Docker Model Runner:

    docker model run hf.co/fuwangwang/mpt-7b
mpt-7b
13.3 GB
Ctrl+K
Ctrl+K
  • 2 contributors
History: 5 commits
fuwangwang's picture
fuwangwang
Create requirements.txt
8353f63 about 3 years ago
  • code
    Create requirements.txt about 3 years ago
  • .gitattributes
    1.48 kB
    initial commit about 3 years ago
  • README.md
    11.6 kB
    add about 3 years ago
  • adapt_tokenizer.py
    1.75 kB
    add about 3 years ago
  • attention.py
    16.8 kB
    add about 3 years ago
  • blocks.py
    2.49 kB
    add about 3 years ago
  • config.json
    1.23 kB
    add about 3 years ago
  • configuration_mpt.py
    9.08 kB
    add about 3 years ago
  • flash_attn_triton.py
    28.2 kB
    add about 3 years ago
  • generation_config.json
    112 Bytes
    add about 3 years ago
  • hf_prefixlm_converter.py
    27.2 kB
    add about 3 years ago
  • meta_init_context.py
    3.64 kB
    add about 3 years ago
  • modeling_mpt.py
    17.4 kB
    add about 3 years ago
  • norm.py
    2.56 kB
    add about 3 years ago
  • param_init_fns.py
    12.6 kB
    add about 3 years ago
  • pytorch_model-00001-of-00002.bin
    9.94 GB
    xet
    add about 3 years ago
  • pytorch_model-00002-of-00002.bin
    3.36 GB
    xet
    add about 3 years ago
  • pytorch_model.bin.index.json
    16 kB
    add about 3 years ago
  • special_tokens_map.json
    99 Bytes
    add about 3 years ago
  • tokenizer.json
    2.11 MB
    add about 3 years ago
  • tokenizer_config.json
    237 Bytes
    add about 3 years ago