Instructions to use hf-internal-testing/tiny-random-PegasusForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hf-internal-testing/tiny-random-PegasusForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hf-internal-testing/tiny-random-PegasusForCausalLM")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-PegasusForCausalLM") model = AutoModelForCausalLM.from_pretrained("hf-internal-testing/tiny-random-PegasusForCausalLM") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use hf-internal-testing/tiny-random-PegasusForCausalLM 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-PegasusForCausalLM" # 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-PegasusForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hf-internal-testing/tiny-random-PegasusForCausalLM
- SGLang
How to use hf-internal-testing/tiny-random-PegasusForCausalLM 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-PegasusForCausalLM" \ --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-PegasusForCausalLM", "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-PegasusForCausalLM" \ --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-PegasusForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hf-internal-testing/tiny-random-PegasusForCausalLM with Docker Model Runner:
docker model run hf.co/hf-internal-testing/tiny-random-PegasusForCausalLM
Upload tiny models for PegasusForCausalLM
Browse files- config.json +2 -3
- generation_config.json +9 -0
- pytorch_model.bin +2 -2
- spiece.model +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +0 -1
config.json
CHANGED
|
@@ -6,7 +6,6 @@
|
|
| 6 |
],
|
| 7 |
"attention_dropout": 0.1,
|
| 8 |
"bos_token_id": 0,
|
| 9 |
-
"classifier_dropout": 0.0,
|
| 10 |
"d_model": 16,
|
| 11 |
"decoder_attention_heads": 4,
|
| 12 |
"decoder_ffn_dim": 4,
|
|
@@ -29,7 +28,7 @@
|
|
| 29 |
"pad_token_id": 0,
|
| 30 |
"scale_embedding": false,
|
| 31 |
"torch_dtype": "float32",
|
| 32 |
-
"transformers_version": "4.
|
| 33 |
"use_cache": true,
|
| 34 |
-
"vocab_size":
|
| 35 |
}
|
|
|
|
| 6 |
],
|
| 7 |
"attention_dropout": 0.1,
|
| 8 |
"bos_token_id": 0,
|
|
|
|
| 9 |
"d_model": 16,
|
| 10 |
"decoder_attention_heads": 4,
|
| 11 |
"decoder_ffn_dim": 4,
|
|
|
|
| 28 |
"pad_token_id": 0,
|
| 29 |
"scale_embedding": false,
|
| 30 |
"torch_dtype": "float32",
|
| 31 |
+
"transformers_version": "4.28.0.dev0",
|
| 32 |
"use_cache": true,
|
| 33 |
+
"vocab_size": 96103
|
| 34 |
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"decoder_start_token_id": 0,
|
| 5 |
+
"eos_token_id": 1,
|
| 6 |
+
"forced_eos_token_id": 1,
|
| 7 |
+
"pad_token_id": 0,
|
| 8 |
+
"transformers_version": "4.28.0.dev0"
|
| 9 |
+
}
|
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:c72d59aa7198d32ea1ef56b5fc209db2d2fc950aa234398f50208dc26123fd7f
|
| 3 |
+
size 6200729
|
spiece.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0015189ef36359283fec8b93cf6d9ce51bca37eb1101defc68a53b394913b96c
|
| 3 |
+
size 1912529
|
tokenizer.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
CHANGED
|
@@ -108,7 +108,6 @@
|
|
| 108 |
"mask_token": "<mask_2>",
|
| 109 |
"mask_token_sent": "<mask_1>",
|
| 110 |
"model_max_length": 200,
|
| 111 |
-
"name_or_path": "google/pegasus-large",
|
| 112 |
"offset": 103,
|
| 113 |
"pad_token": "<pad>",
|
| 114 |
"sp_model_kwargs": {},
|
|
|
|
| 108 |
"mask_token": "<mask_2>",
|
| 109 |
"mask_token_sent": "<mask_1>",
|
| 110 |
"model_max_length": 200,
|
|
|
|
| 111 |
"offset": 103,
|
| 112 |
"pad_token": "<pad>",
|
| 113 |
"sp_model_kwargs": {},
|