Instructions to use barbaroo/gptsw3-6.7B-translation-en-fo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use barbaroo/gptsw3-6.7B-translation-en-fo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="barbaroo/gptsw3-6.7B-translation-en-fo")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("barbaroo/gptsw3-6.7B-translation-en-fo") model = AutoModelForCausalLM.from_pretrained("barbaroo/gptsw3-6.7B-translation-en-fo", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use barbaroo/gptsw3-6.7B-translation-en-fo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "barbaroo/gptsw3-6.7B-translation-en-fo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "barbaroo/gptsw3-6.7B-translation-en-fo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/barbaroo/gptsw3-6.7B-translation-en-fo
- SGLang
How to use barbaroo/gptsw3-6.7B-translation-en-fo 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 "barbaroo/gptsw3-6.7B-translation-en-fo" \ --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": "barbaroo/gptsw3-6.7B-translation-en-fo", "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 "barbaroo/gptsw3-6.7B-translation-en-fo" \ --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": "barbaroo/gptsw3-6.7B-translation-en-fo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use barbaroo/gptsw3-6.7B-translation-en-fo with Docker Model Runner:
docker model run hf.co/barbaroo/gptsw3-6.7B-translation-en-fo
Refresh: aligned EOS/PAD + generation_config
Browse files- config.json +1 -1
- generation_config.json +1 -1
- special_tokens_map.json +28 -4
config.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
| 7 |
"attn_pdrop": 0.1,
|
| 8 |
"bos_token_id": 1,
|
| 9 |
"embd_pdrop": 0.1,
|
| 10 |
-
"eos_token_id":
|
| 11 |
"initializer_range": 0.01,
|
| 12 |
"layer_norm_epsilon": 1e-05,
|
| 13 |
"model_type": "gpt2",
|
|
|
|
| 7 |
"attn_pdrop": 0.1,
|
| 8 |
"bos_token_id": 1,
|
| 9 |
"embd_pdrop": 0.1,
|
| 10 |
+
"eos_token_id": 3,
|
| 11 |
"initializer_range": 0.01,
|
| 12 |
"layer_norm_epsilon": 1e-05,
|
| 13 |
"model_type": "gpt2",
|
generation_config.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 1,
|
| 4 |
-
"eos_token_id":
|
| 5 |
"pad_token_id": 0,
|
| 6 |
"transformers_version": "4.50.3"
|
| 7 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 3,
|
| 5 |
"pad_token_id": 0,
|
| 6 |
"transformers_version": "4.50.3"
|
| 7 |
}
|
special_tokens_map.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
| 1 |
{
|
| 2 |
-
"bos_token":
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<s>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "<|endoftext|>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"pad_token": {
|
| 17 |
+
"content": "<pad>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"unk_token": {
|
| 24 |
+
"content": "<unk>",
|
| 25 |
+
"lstrip": false,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
}
|
| 30 |
}
|