Instructions to use hf-internal-testing/tiny-random-BartForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hf-internal-testing/tiny-random-BartForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hf-internal-testing/tiny-random-BartForCausalLM")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-BartForCausalLM") model = AutoModelForCausalLM.from_pretrained("hf-internal-testing/tiny-random-BartForCausalLM") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use hf-internal-testing/tiny-random-BartForCausalLM 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-BartForCausalLM" # 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-BartForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hf-internal-testing/tiny-random-BartForCausalLM
- SGLang
How to use hf-internal-testing/tiny-random-BartForCausalLM 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-BartForCausalLM" \ --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-BartForCausalLM", "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-BartForCausalLM" \ --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-BartForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hf-internal-testing/tiny-random-BartForCausalLM with Docker Model Runner:
docker model run hf.co/hf-internal-testing/tiny-random-BartForCausalLM
Upload tiny models for BartForCausalLM
Browse files- config.json +1 -1
- generation_config.json +8 -0
- pytorch_model.bin +1 -1
- tokenizer_config.json +1 -1
config.json
CHANGED
|
@@ -39,7 +39,7 @@
|
|
| 39 |
"pad_token_id": 1,
|
| 40 |
"scale_embedding": false,
|
| 41 |
"torch_dtype": "float32",
|
| 42 |
-
"transformers_version": "4.
|
| 43 |
"use_cache": true,
|
| 44 |
"vocab_size": 1024
|
| 45 |
}
|
|
|
|
| 39 |
"pad_token_id": 1,
|
| 40 |
"scale_embedding": false,
|
| 41 |
"torch_dtype": "float32",
|
| 42 |
+
"transformers_version": "4.28.0.dev0",
|
| 43 |
"use_cache": true,
|
| 44 |
"vocab_size": 1024
|
| 45 |
}
|
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 109401
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6d681b54a44363599d269200a346e54013727b696223fa4cf676ce18f1ca1503
|
| 3 |
size 109401
|
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>",
|
|
@@ -34,7 +35,6 @@
|
|
| 34 |
"single_word": false
|
| 35 |
},
|
| 36 |
"model_max_length": 100,
|
| 37 |
-
"name_or_path": "temp/dummy/bart/processors",
|
| 38 |
"pad_token": {
|
| 39 |
"__type": "AddedToken",
|
| 40 |
"content": "<pad>",
|
|
|
|
| 8 |
"rstrip": false,
|
| 9 |
"single_word": false
|
| 10 |
},
|
| 11 |
+
"clean_up_tokenization_spaces": true,
|
| 12 |
"cls_token": {
|
| 13 |
"__type": "AddedToken",
|
| 14 |
"content": "<s>",
|
|
|
|
| 35 |
"single_word": false
|
| 36 |
},
|
| 37 |
"model_max_length": 100,
|
|
|
|
| 38 |
"pad_token": {
|
| 39 |
"__type": "AddedToken",
|
| 40 |
"content": "<pad>",
|