Instructions to use hf-internal-testing/tiny-random-MegaForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hf-internal-testing/tiny-random-MegaForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hf-internal-testing/tiny-random-MegaForCausalLM")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("hf-internal-testing/tiny-random-MegaForCausalLM", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use hf-internal-testing/tiny-random-MegaForCausalLM 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-MegaForCausalLM" # 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-MegaForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hf-internal-testing/tiny-random-MegaForCausalLM
- SGLang
How to use hf-internal-testing/tiny-random-MegaForCausalLM 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-MegaForCausalLM" \ --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-MegaForCausalLM", "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-MegaForCausalLM" \ --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-MegaForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hf-internal-testing/tiny-random-MegaForCausalLM with Docker Model Runner:
docker model run hf.co/hf-internal-testing/tiny-random-MegaForCausalLM
Commit ·
d4d7808
1
Parent(s): 6642b9d
Update tiny models for MegaForCausalLM
Browse files- pytorch_model.bin +1 -1
- tokenizer.json +1 -0
- tokenizer_config.json +1 -0
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 410069
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:47c43aeb733480946939187fe9c7776b595ead51c0d0850e9a3edfb5577b4e2e
|
| 3 |
size 410069
|
tokenizer.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
| 82 |
"continuing_subword_prefix": "",
|
| 83 |
"end_of_word_suffix": "",
|
| 84 |
"fuse_unk": false,
|
|
|
|
| 85 |
"vocab": {
|
| 86 |
"<s>": 0,
|
| 87 |
"<pad>": 1,
|
|
|
|
| 82 |
"continuing_subword_prefix": "",
|
| 83 |
"end_of_word_suffix": "",
|
| 84 |
"fuse_unk": false,
|
| 85 |
+
"byte_fallback": false,
|
| 86 |
"vocab": {
|
| 87 |
"<s>": 0,
|
| 88 |
"<pad>": 1,
|
tokenizer_config.json
CHANGED
|
@@ -8,6 +8,7 @@
|
|
| 8 |
"rstrip": false,
|
| 9 |
"single_word": false
|
| 10 |
},
|
|
|
|
| 11 |
"cls_token": {
|
| 12 |
"__type": "AddedToken",
|
| 13 |
"content": "<s>",
|
|
|
|
| 8 |
"rstrip": false,
|
| 9 |
"single_word": false
|
| 10 |
},
|
| 11 |
+
"clean_up_tokenization_spaces": true,
|
| 12 |
"cls_token": {
|
| 13 |
"__type": "AddedToken",
|
| 14 |
"content": "<s>",
|