Instructions to use hf-internal-testing/tiny-random-XGLMForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hf-internal-testing/tiny-random-XGLMForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hf-internal-testing/tiny-random-XGLMForCausalLM")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-XGLMForCausalLM") model = AutoModelForCausalLM.from_pretrained("hf-internal-testing/tiny-random-XGLMForCausalLM") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use hf-internal-testing/tiny-random-XGLMForCausalLM 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-XGLMForCausalLM" # 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-XGLMForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hf-internal-testing/tiny-random-XGLMForCausalLM
- SGLang
How to use hf-internal-testing/tiny-random-XGLMForCausalLM 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-XGLMForCausalLM" \ --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-XGLMForCausalLM", "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-XGLMForCausalLM" \ --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-XGLMForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hf-internal-testing/tiny-random-XGLMForCausalLM with Docker Model Runner:
docker model run hf.co/hf-internal-testing/tiny-random-XGLMForCausalLM
Upload tiny models for XGLMForCausalLM
Browse files- .gitattributes +1 -0
- config.json +3 -3
- generation_config.json +8 -0
- pytorch_model.bin +2 -2
- sentencepiece.bpe.model +3 -0
- tf_model.h5 +2 -2
- tokenizer.json +0 -0
- tokenizer_config.json +1 -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
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "
|
| 3 |
"activation_dropout": 0.1,
|
| 4 |
"activation_function": "gelu",
|
| 5 |
"architectures": [
|
|
@@ -24,7 +24,7 @@
|
|
| 24 |
"pad_token_id": 1,
|
| 25 |
"scale_embedding": true,
|
| 26 |
"torch_dtype": "float32",
|
| 27 |
-
"transformers_version": "4.
|
| 28 |
"use_cache": true,
|
| 29 |
-
"vocab_size":
|
| 30 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "tiny_models/xglm/XGLMForCausalLM",
|
| 3 |
"activation_dropout": 0.1,
|
| 4 |
"activation_function": "gelu",
|
| 5 |
"architectures": [
|
|
|
|
| 24 |
"pad_token_id": 1,
|
| 25 |
"scale_embedding": true,
|
| 26 |
"torch_dtype": "float32",
|
| 27 |
+
"transformers_version": "4.28.0.dev0",
|
| 28 |
"use_cache": true,
|
| 29 |
+
"vocab_size": 256008
|
| 30 |
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"decoder_start_token_id": 2,
|
| 5 |
+
"eos_token_id": 2,
|
| 6 |
+
"pad_token_id": 1,
|
| 7 |
+
"transformers_version": "4.28.0.dev0"
|
| 8 |
+
}
|
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:912f768c127c4827b85180eab2e52532ffd445a8169af40814f917a1175233ca
|
| 3 |
+
size 32930730
|
sentencepiece.bpe.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c49dc7e82c10227af764e518924cf2f9d50c00462750d184fa74697bba65eef8
|
| 3 |
+
size 4920706
|
tf_model.h5
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:fa7859c92ab4d337edc06597e5637c9de7ecb7f64746b60d5e6008461495bfb1
|
| 3 |
+
size 65836840
|
tokenizer.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
CHANGED
|
@@ -12,11 +12,11 @@
|
|
| 12 |
"cls_token": "<s>",
|
| 13 |
"eos_token": "</s>",
|
| 14 |
"model_max_length": 512,
|
| 15 |
-
"name_or_path": "facebook/xglm-564M",
|
| 16 |
"pad_token": "<pad>",
|
| 17 |
"sep_token": "</s>",
|
| 18 |
"sp_model_kwargs": {},
|
| 19 |
"special_tokens_map_file": "hf_models/xglm-564M/special_tokens_map.json",
|
| 20 |
"tokenizer_class": "XGLMTokenizer",
|
|
|
|
| 21 |
"unk_token": "<unk>"
|
| 22 |
}
|
|
|
|
| 12 |
"cls_token": "<s>",
|
| 13 |
"eos_token": "</s>",
|
| 14 |
"model_max_length": 512,
|
|
|
|
| 15 |
"pad_token": "<pad>",
|
| 16 |
"sep_token": "</s>",
|
| 17 |
"sp_model_kwargs": {},
|
| 18 |
"special_tokens_map_file": "hf_models/xglm-564M/special_tokens_map.json",
|
| 19 |
"tokenizer_class": "XGLMTokenizer",
|
| 20 |
+
"tokenizer_file": null,
|
| 21 |
"unk_token": "<unk>"
|
| 22 |
}
|