Instructions to use yujiepan/mpt-tiny-random with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yujiepan/mpt-tiny-random with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yujiepan/mpt-tiny-random", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("yujiepan/mpt-tiny-random", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("yujiepan/mpt-tiny-random", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use yujiepan/mpt-tiny-random with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yujiepan/mpt-tiny-random" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yujiepan/mpt-tiny-random", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/yujiepan/mpt-tiny-random
- SGLang
How to use yujiepan/mpt-tiny-random 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 "yujiepan/mpt-tiny-random" \ --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": "yujiepan/mpt-tiny-random", "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 "yujiepan/mpt-tiny-random" \ --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": "yujiepan/mpt-tiny-random", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use yujiepan/mpt-tiny-random with Docker Model Runner:
docker model run hf.co/yujiepan/mpt-tiny-random
Upload folder using huggingface_hub
Browse files- config.json +3 -2
- generation_config.json +1 -2
- openvino_model.bin +3 -0
- openvino_model.xml +0 -0
- pytorch_model.bin +1 -1
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "
|
| 3 |
"architectures": [
|
| 4 |
"MptForCausalLM"
|
| 5 |
],
|
|
@@ -27,6 +27,7 @@
|
|
| 27 |
},
|
| 28 |
"init_device": "cpu",
|
| 29 |
"initializer_range": 0.02,
|
|
|
|
| 30 |
"layer_norm_epsilon": 1e-05,
|
| 31 |
"learned_pos_emb": true,
|
| 32 |
"logit_scale": null,
|
|
@@ -41,7 +42,7 @@
|
|
| 41 |
"tokenizer_name": "EleutherAI/gpt-neox-20b",
|
| 42 |
"torch_dtype": "float16",
|
| 43 |
"transformers_version": "4.34.1",
|
| 44 |
-
"use_cache":
|
| 45 |
"verbose": 0,
|
| 46 |
"vocab_size": 50432
|
| 47 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "/tmp/yujiepan/mpt-tiny-random/config.json",
|
| 3 |
"architectures": [
|
| 4 |
"MptForCausalLM"
|
| 5 |
],
|
|
|
|
| 27 |
},
|
| 28 |
"init_device": "cpu",
|
| 29 |
"initializer_range": 0.02,
|
| 30 |
+
"is_decoder": true,
|
| 31 |
"layer_norm_epsilon": 1e-05,
|
| 32 |
"learned_pos_emb": true,
|
| 33 |
"logit_scale": null,
|
|
|
|
| 42 |
"tokenizer_name": "EleutherAI/gpt-neox-20b",
|
| 43 |
"torch_dtype": "float16",
|
| 44 |
"transformers_version": "4.34.1",
|
| 45 |
+
"use_cache": true,
|
| 46 |
"verbose": 0,
|
| 47 |
"vocab_size": 50432
|
| 48 |
}
|
generation_config.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
-
"transformers_version": "4.34.1"
|
| 4 |
-
"use_cache": false
|
| 5 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
+
"transformers_version": "4.34.1"
|
|
|
|
| 4 |
}
|
openvino_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2d981f272bf256577fa3ba97a8c23f4975fb0f1b4f0b077419542e88c98d9827
|
| 3 |
+
size 818595
|
openvino_model.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 815064
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9b208d69cc632b6d306708b2eb8a884af0a3fd8454e660464e3431f7e2a256ba
|
| 3 |
size 815064
|