Text Generation
Transformers
Safetensors
qwen3_5
image-text-to-text
translation
machine-translation
african-languages
multilingual
conversational
qwen3.5
Instructions to use qvac/TranslatePsy-AfriSLM-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use qvac/TranslatePsy-AfriSLM-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="qvac/TranslatePsy-AfriSLM-4B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("qvac/TranslatePsy-AfriSLM-4B") model = AutoModelForMultimodalLM.from_pretrained("qvac/TranslatePsy-AfriSLM-4B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use qvac/TranslatePsy-AfriSLM-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "qvac/TranslatePsy-AfriSLM-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qvac/TranslatePsy-AfriSLM-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/qvac/TranslatePsy-AfriSLM-4B
- SGLang
How to use qvac/TranslatePsy-AfriSLM-4B 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 "qvac/TranslatePsy-AfriSLM-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qvac/TranslatePsy-AfriSLM-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "qvac/TranslatePsy-AfriSLM-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qvac/TranslatePsy-AfriSLM-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use qvac/TranslatePsy-AfriSLM-4B with Docker Model Runner:
docker model run hf.co/qvac/TranslatePsy-AfriSLM-4B
Upload folder using huggingface_hub
Browse files- config.json +10 -18
- generation_config.json +3 -1
- model.safetensors +2 -2
- preprocessor_config.json +21 -0
- tokenizer.json +2 -2
- tokenizer_config.json +1 -2
- video_preprocessor_config.json +21 -0
config.json
CHANGED
|
@@ -2,19 +2,14 @@
|
|
| 2 |
"architectures": [
|
| 3 |
"Qwen3_5ForConditionalGeneration"
|
| 4 |
],
|
| 5 |
-
"bos_token_id": null,
|
| 6 |
-
"dtype": "bfloat16",
|
| 7 |
-
"eos_token_id": 248046,
|
| 8 |
"image_token_id": 248056,
|
| 9 |
"model_type": "qwen3_5",
|
| 10 |
-
"pad_token_id": 248044,
|
| 11 |
"text_config": {
|
| 12 |
"attention_bias": false,
|
| 13 |
"attention_dropout": 0.0,
|
| 14 |
"attn_output_gate": true,
|
| 15 |
-
"bos_token_id": null,
|
| 16 |
"dtype": "bfloat16",
|
| 17 |
-
"eos_token_id":
|
| 18 |
"full_attention_interval": 4,
|
| 19 |
"head_dim": 256,
|
| 20 |
"hidden_act": "silu",
|
|
@@ -69,8 +64,7 @@
|
|
| 69 |
"num_attention_heads": 16,
|
| 70 |
"num_hidden_layers": 32,
|
| 71 |
"num_key_value_heads": 4,
|
| 72 |
-
"pad_token_id":
|
| 73 |
-
"partial_rotary_factor": 0.25,
|
| 74 |
"rms_norm_eps": 1e-06,
|
| 75 |
"rope_parameters": {
|
| 76 |
"mrope_interleaved": true,
|
|
@@ -83,30 +77,28 @@
|
|
| 83 |
"rope_theta": 10000000,
|
| 84 |
"rope_type": "default"
|
| 85 |
},
|
| 86 |
-
"
|
| 87 |
-
"use_cache": true,
|
| 88 |
"vocab_size": 248320
|
| 89 |
},
|
| 90 |
"tie_word_embeddings": true,
|
| 91 |
-
"transformers_version": "5.
|
| 92 |
"video_token_id": 248057,
|
| 93 |
"vision_config": {
|
| 94 |
"deepstack_visual_indexes": [],
|
| 95 |
-
"depth":
|
| 96 |
-
"dtype": "bfloat16",
|
| 97 |
"hidden_act": "gelu_pytorch_tanh",
|
| 98 |
-
"hidden_size":
|
| 99 |
"in_channels": 3,
|
| 100 |
"initializer_range": 0.02,
|
| 101 |
-
"intermediate_size":
|
| 102 |
"model_type": "qwen3_5",
|
| 103 |
-
"num_heads":
|
| 104 |
"num_position_embeddings": 2304,
|
| 105 |
-
"out_hidden_size":
|
| 106 |
"patch_size": 16,
|
| 107 |
"spatial_merge_size": 2,
|
| 108 |
"temporal_patch_size": 2
|
| 109 |
},
|
| 110 |
"vision_end_token_id": 248054,
|
| 111 |
"vision_start_token_id": 248053
|
| 112 |
-
}
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"Qwen3_5ForConditionalGeneration"
|
| 4 |
],
|
|
|
|
|
|
|
|
|
|
| 5 |
"image_token_id": 248056,
|
| 6 |
"model_type": "qwen3_5",
|
|
|
|
| 7 |
"text_config": {
|
| 8 |
"attention_bias": false,
|
| 9 |
"attention_dropout": 0.0,
|
| 10 |
"attn_output_gate": true,
|
|
|
|
| 11 |
"dtype": "bfloat16",
|
| 12 |
+
"eos_token_id": 248046,
|
| 13 |
"full_attention_interval": 4,
|
| 14 |
"head_dim": 256,
|
| 15 |
"hidden_act": "silu",
|
|
|
|
| 64 |
"num_attention_heads": 16,
|
| 65 |
"num_hidden_layers": 32,
|
| 66 |
"num_key_value_heads": 4,
|
| 67 |
+
"pad_token_id": 248044,
|
|
|
|
| 68 |
"rms_norm_eps": 1e-06,
|
| 69 |
"rope_parameters": {
|
| 70 |
"mrope_interleaved": true,
|
|
|
|
| 77 |
"rope_theta": 10000000,
|
| 78 |
"rope_type": "default"
|
| 79 |
},
|
| 80 |
+
"use_cache": false,
|
|
|
|
| 81 |
"vocab_size": 248320
|
| 82 |
},
|
| 83 |
"tie_word_embeddings": true,
|
| 84 |
+
"transformers_version": "5.8.1",
|
| 85 |
"video_token_id": 248057,
|
| 86 |
"vision_config": {
|
| 87 |
"deepstack_visual_indexes": [],
|
| 88 |
+
"depth": 12,
|
|
|
|
| 89 |
"hidden_act": "gelu_pytorch_tanh",
|
| 90 |
+
"hidden_size": 768,
|
| 91 |
"in_channels": 3,
|
| 92 |
"initializer_range": 0.02,
|
| 93 |
+
"intermediate_size": 3072,
|
| 94 |
"model_type": "qwen3_5",
|
| 95 |
+
"num_heads": 12,
|
| 96 |
"num_position_embeddings": 2304,
|
| 97 |
+
"out_hidden_size": 1024,
|
| 98 |
"patch_size": 16,
|
| 99 |
"spatial_merge_size": 2,
|
| 100 |
"temporal_patch_size": 2
|
| 101 |
},
|
| 102 |
"vision_end_token_id": 248054,
|
| 103 |
"vision_start_token_id": 248053
|
| 104 |
+
}
|
generation_config.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"eos_token_id": [
|
| 3 |
248046,
|
| 4 |
248044
|
| 5 |
],
|
| 6 |
-
"
|
|
|
|
| 7 |
"use_cache": true
|
| 8 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
"eos_token_id": [
|
| 4 |
248046,
|
| 5 |
248044
|
| 6 |
],
|
| 7 |
+
"pad_token_id": 248044,
|
| 8 |
+
"transformers_version": "5.8.1",
|
| 9 |
"use_cache": true
|
| 10 |
}
|
model.safetensors
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:fafce3903441b34d037206e0b5cde958afbe490bc6ce85c2dcad1a92e6b2bb6b
|
| 3 |
+
size 9884159784
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"size": {
|
| 3 |
+
"longest_edge": 16777216,
|
| 4 |
+
"shortest_edge": 65536
|
| 5 |
+
},
|
| 6 |
+
"patch_size": 16,
|
| 7 |
+
"temporal_patch_size": 2,
|
| 8 |
+
"merge_size": 2,
|
| 9 |
+
"image_mean": [
|
| 10 |
+
0.5,
|
| 11 |
+
0.5,
|
| 12 |
+
0.5
|
| 13 |
+
],
|
| 14 |
+
"image_std": [
|
| 15 |
+
0.5,
|
| 16 |
+
0.5,
|
| 17 |
+
0.5
|
| 18 |
+
],
|
| 19 |
+
"processor_class": "Qwen3VLProcessor",
|
| 20 |
+
"image_processor_type": "Qwen2VLImageProcessorFast"
|
| 21 |
+
}
|
tokenizer.json
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:06b9509352d2af50381ab2247e083b80d32d5c0aba91c272ca9ff729b6a0e523
|
| 3 |
+
size 19989325
|
tokenizer_config.json
CHANGED
|
@@ -23,9 +23,8 @@
|
|
| 23 |
},
|
| 24 |
"pad_token": "<|endoftext|>",
|
| 25 |
"pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
|
| 26 |
-
"processor_class": "Qwen3VLProcessor",
|
| 27 |
"split_special_tokens": false,
|
| 28 |
-
"tokenizer_class": "
|
| 29 |
"unk_token": null,
|
| 30 |
"video_token": "<|video_pad|>",
|
| 31 |
"vision_bos_token": "<|vision_start|>",
|
|
|
|
| 23 |
},
|
| 24 |
"pad_token": "<|endoftext|>",
|
| 25 |
"pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
|
|
|
|
| 26 |
"split_special_tokens": false,
|
| 27 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 28 |
"unk_token": null,
|
| 29 |
"video_token": "<|video_pad|>",
|
| 30 |
"vision_bos_token": "<|vision_start|>",
|
video_preprocessor_config.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"size": {
|
| 3 |
+
"longest_edge": 25165824,
|
| 4 |
+
"shortest_edge": 4096
|
| 5 |
+
},
|
| 6 |
+
"patch_size": 16,
|
| 7 |
+
"temporal_patch_size": 2,
|
| 8 |
+
"merge_size": 2,
|
| 9 |
+
"image_mean": [
|
| 10 |
+
0.5,
|
| 11 |
+
0.5,
|
| 12 |
+
0.5
|
| 13 |
+
],
|
| 14 |
+
"image_std": [
|
| 15 |
+
0.5,
|
| 16 |
+
0.5,
|
| 17 |
+
0.5
|
| 18 |
+
],
|
| 19 |
+
"processor_class": "Qwen3VLProcessor",
|
| 20 |
+
"video_processor_type": "Qwen3VLVideoProcessor"
|
| 21 |
+
}
|