Instructions to use hf-internal-testing/tiny-random-XmodForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hf-internal-testing/tiny-random-XmodForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hf-internal-testing/tiny-random-XmodForCausalLM")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-XmodForCausalLM") model = AutoModelForCausalLM.from_pretrained("hf-internal-testing/tiny-random-XmodForCausalLM") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use hf-internal-testing/tiny-random-XmodForCausalLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hf-internal-testing/tiny-random-XmodForCausalLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hf-internal-testing/tiny-random-XmodForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hf-internal-testing/tiny-random-XmodForCausalLM
- SGLang
How to use hf-internal-testing/tiny-random-XmodForCausalLM 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 "hf-internal-testing/tiny-random-XmodForCausalLM" \ --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": "hf-internal-testing/tiny-random-XmodForCausalLM", "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 "hf-internal-testing/tiny-random-XmodForCausalLM" \ --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": "hf-internal-testing/tiny-random-XmodForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hf-internal-testing/tiny-random-XmodForCausalLM with Docker Model Runner:
docker model run hf.co/hf-internal-testing/tiny-random-XmodForCausalLM
Upload tiny models for XmodForCausalLM
Browse files- .gitattributes +1 -0
- config.json +1 -1
- pytorch_model.bin +2 -2
- sentencepiece.bpe.model +3 -0
- special_tokens_map.json +1 -1
- tokenizer.json +0 -0
- tokenizer_config.json +2 -1
.gitattributes
CHANGED
|
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
config.json
CHANGED
|
@@ -32,5 +32,5 @@
|
|
| 32 |
"transformers_version": "4.28.0.dev0",
|
| 33 |
"type_vocab_size": 16,
|
| 34 |
"use_cache": true,
|
| 35 |
-
"vocab_size":
|
| 36 |
}
|
|
|
|
| 32 |
"transformers_version": "4.28.0.dev0",
|
| 33 |
"type_vocab_size": 16,
|
| 34 |
"use_cache": true,
|
| 35 |
+
"vocab_size": 250002
|
| 36 |
}
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d8ef21f519085111883deb8a166218fee3aef647efbc49ffe1ffba81e4ccf46b
|
| 3 |
+
size 33270025
|
sentencepiece.bpe.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
|
| 3 |
+
size 5069051
|
special_tokens_map.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
"mask_token": {
|
| 6 |
"content": "<mask>",
|
| 7 |
"lstrip": true,
|
| 8 |
-
"normalized":
|
| 9 |
"rstrip": false,
|
| 10 |
"single_word": false
|
| 11 |
},
|
|
|
|
| 5 |
"mask_token": {
|
| 6 |
"content": "<mask>",
|
| 7 |
"lstrip": true,
|
| 8 |
+
"normalized": true,
|
| 9 |
"rstrip": false,
|
| 10 |
"single_word": false
|
| 11 |
},
|
tokenizer.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
CHANGED
|
@@ -6,13 +6,14 @@
|
|
| 6 |
"__type": "AddedToken",
|
| 7 |
"content": "<mask>",
|
| 8 |
"lstrip": true,
|
| 9 |
-
"normalized":
|
| 10 |
"rstrip": false,
|
| 11 |
"single_word": false
|
| 12 |
},
|
| 13 |
"model_max_length": 510,
|
| 14 |
"pad_token": "<pad>",
|
| 15 |
"sep_token": "</s>",
|
|
|
|
| 16 |
"special_tokens_map_file": null,
|
| 17 |
"tokenizer_class": "XLMRobertaTokenizer",
|
| 18 |
"unk_token": "<unk>"
|
|
|
|
| 6 |
"__type": "AddedToken",
|
| 7 |
"content": "<mask>",
|
| 8 |
"lstrip": true,
|
| 9 |
+
"normalized": true,
|
| 10 |
"rstrip": false,
|
| 11 |
"single_word": false
|
| 12 |
},
|
| 13 |
"model_max_length": 510,
|
| 14 |
"pad_token": "<pad>",
|
| 15 |
"sep_token": "</s>",
|
| 16 |
+
"sp_model_kwargs": {},
|
| 17 |
"special_tokens_map_file": null,
|
| 18 |
"tokenizer_class": "XLMRobertaTokenizer",
|
| 19 |
"unk_token": "<unk>"
|