Instructions to use pirxus/s2t2_decoder_base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pirxus/s2t2_decoder_base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pirxus/s2t2_decoder_base")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("pirxus/s2t2_decoder_base", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use pirxus/s2t2_decoder_base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pirxus/s2t2_decoder_base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pirxus/s2t2_decoder_base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/pirxus/s2t2_decoder_base
- SGLang
How to use pirxus/s2t2_decoder_base 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 "pirxus/s2t2_decoder_base" \ --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": "pirxus/s2t2_decoder_base", "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 "pirxus/s2t2_decoder_base" \ --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": "pirxus/s2t2_decoder_base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use pirxus/s2t2_decoder_base with Docker Model Runner:
docker model run hf.co/pirxus/s2t2_decoder_base
Upload Speech2Text2ForCausalLM
Browse files- config.json +28 -0
- generation_config.json +8 -0
- pytorch_model.bin +3 -0
config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_dropout": 0.0,
|
| 3 |
+
"activation_function": "relu",
|
| 4 |
+
"architectures": [
|
| 5 |
+
"Speech2Text2ForCausalLM"
|
| 6 |
+
],
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
+
"bos_token_id": 0,
|
| 9 |
+
"d_model": 256,
|
| 10 |
+
"decoder_attention_heads": 4,
|
| 11 |
+
"decoder_ffn_dim": 2048,
|
| 12 |
+
"decoder_layerdrop": 0.0,
|
| 13 |
+
"decoder_layers": 6,
|
| 14 |
+
"decoder_start_token_id": 2,
|
| 15 |
+
"dropout": 0.1,
|
| 16 |
+
"eos_token_id": 2,
|
| 17 |
+
"init_std": 0.02,
|
| 18 |
+
"is_decoder": true,
|
| 19 |
+
"max_target_positions": 1024,
|
| 20 |
+
"model_type": "speech_to_text_2",
|
| 21 |
+
"num_hidden_layers": 6,
|
| 22 |
+
"pad_token_id": 1,
|
| 23 |
+
"scale_embedding": true,
|
| 24 |
+
"torch_dtype": "float32",
|
| 25 |
+
"transformers_version": "4.31.0",
|
| 26 |
+
"use_cache": true,
|
| 27 |
+
"vocab_size": 10000
|
| 28 |
+
}
|
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.31.0"
|
| 8 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:901089ccf280c51c25e7812755f45c95795f9de114d0bf71f1cc7af824e9bdce
|
| 3 |
+
size 49232578
|