Text Generation
Transformers
Safetensors
gemma4
image-text-to-text
emotional-support
companion
on-device
conversational
emotion
doi:10.5281/zenodo.23179311
Eval Results
Instructions to use Lythri/Lythri-Tada-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Lythri/Lythri-Tada-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Lythri/Lythri-Tada-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("Lythri/Lythri-Tada-4B") model = AutoModelForMultimodalLM.from_pretrained("Lythri/Lythri-Tada-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 Lythri/Lythri-Tada-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Lythri/Lythri-Tada-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": "Lythri/Lythri-Tada-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Lythri/Lythri-Tada-4B
- SGLang
How to use Lythri/Lythri-Tada-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 "Lythri/Lythri-Tada-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": "Lythri/Lythri-Tada-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 "Lythri/Lythri-Tada-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": "Lythri/Lythri-Tada-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Lythri/Lythri-Tada-4B with Docker Model Runner:
docker model run hf.co/Lythri/Lythri-Tada-4B
config
Browse files- config.json +129 -0
config.json
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Gemma4ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"audio_config": null,
|
| 6 |
+
"audio_token_id": 258881,
|
| 7 |
+
"boa_token_id": 256000,
|
| 8 |
+
"boi_token_id": 255999,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"eoa_token_id": 258883,
|
| 11 |
+
"eoa_token_index": 258883,
|
| 12 |
+
"eoi_token_id": 258882,
|
| 13 |
+
"image_token_id": 258880,
|
| 14 |
+
"initializer_range": 0.02,
|
| 15 |
+
"model_type": "gemma4",
|
| 16 |
+
"text_config": {
|
| 17 |
+
"attention_bias": false,
|
| 18 |
+
"attention_dropout": 0.0,
|
| 19 |
+
"attention_k_eq_v": false,
|
| 20 |
+
"bos_token_id": 2,
|
| 21 |
+
"dtype": "float32",
|
| 22 |
+
"enable_moe_block": false,
|
| 23 |
+
"eos_token_id": 106,
|
| 24 |
+
"expert_intermediate_size": null,
|
| 25 |
+
"final_logit_softcapping": 30.0,
|
| 26 |
+
"head_dim": 256,
|
| 27 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 28 |
+
"hidden_size": 1536,
|
| 29 |
+
"hidden_size_per_layer_input": 256,
|
| 30 |
+
"initializer_range": 0.02,
|
| 31 |
+
"intermediate_size": 6144,
|
| 32 |
+
"layer_types": [
|
| 33 |
+
"sliding_attention",
|
| 34 |
+
"sliding_attention",
|
| 35 |
+
"sliding_attention",
|
| 36 |
+
"sliding_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"sliding_attention",
|
| 40 |
+
"sliding_attention",
|
| 41 |
+
"sliding_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"sliding_attention",
|
| 44 |
+
"sliding_attention",
|
| 45 |
+
"sliding_attention",
|
| 46 |
+
"sliding_attention",
|
| 47 |
+
"full_attention",
|
| 48 |
+
"sliding_attention",
|
| 49 |
+
"sliding_attention",
|
| 50 |
+
"sliding_attention",
|
| 51 |
+
"sliding_attention",
|
| 52 |
+
"full_attention",
|
| 53 |
+
"sliding_attention",
|
| 54 |
+
"sliding_attention",
|
| 55 |
+
"sliding_attention",
|
| 56 |
+
"sliding_attention",
|
| 57 |
+
"full_attention",
|
| 58 |
+
"sliding_attention",
|
| 59 |
+
"sliding_attention",
|
| 60 |
+
"sliding_attention",
|
| 61 |
+
"sliding_attention",
|
| 62 |
+
"full_attention",
|
| 63 |
+
"sliding_attention",
|
| 64 |
+
"sliding_attention",
|
| 65 |
+
"sliding_attention",
|
| 66 |
+
"sliding_attention",
|
| 67 |
+
"full_attention"
|
| 68 |
+
],
|
| 69 |
+
"max_position_embeddings": 131072,
|
| 70 |
+
"model_type": "gemma4_text",
|
| 71 |
+
"moe_intermediate_size": null,
|
| 72 |
+
"num_attention_heads": 8,
|
| 73 |
+
"num_experts": null,
|
| 74 |
+
"num_hidden_layers": 35,
|
| 75 |
+
"num_key_value_heads": 1,
|
| 76 |
+
"num_kv_shared_layers": 20,
|
| 77 |
+
"pad_token_id": 0,
|
| 78 |
+
"per_layer_config": {
|
| 79 |
+
"04": {
|
| 80 |
+
"head_dim": 512
|
| 81 |
+
},
|
| 82 |
+
"09": {
|
| 83 |
+
"head_dim": 512
|
| 84 |
+
},
|
| 85 |
+
"14": {
|
| 86 |
+
"head_dim": 512
|
| 87 |
+
},
|
| 88 |
+
"19": {
|
| 89 |
+
"head_dim": 512
|
| 90 |
+
},
|
| 91 |
+
"24": {
|
| 92 |
+
"head_dim": 512
|
| 93 |
+
},
|
| 94 |
+
"29": {
|
| 95 |
+
"head_dim": 512
|
| 96 |
+
},
|
| 97 |
+
"34": {
|
| 98 |
+
"head_dim": 512
|
| 99 |
+
}
|
| 100 |
+
},
|
| 101 |
+
"rms_norm_eps": 1e-06,
|
| 102 |
+
"rope_parameters": {
|
| 103 |
+
"full_attention": {
|
| 104 |
+
"partial_rotary_factor": 0.25,
|
| 105 |
+
"rope_theta": 1000000.0,
|
| 106 |
+
"rope_type": "proportional"
|
| 107 |
+
},
|
| 108 |
+
"sliding_attention": {
|
| 109 |
+
"rope_theta": 10000.0,
|
| 110 |
+
"rope_type": "default"
|
| 111 |
+
}
|
| 112 |
+
},
|
| 113 |
+
"sliding_window": 512,
|
| 114 |
+
"tie_word_embeddings": true,
|
| 115 |
+
"top_k_experts": null,
|
| 116 |
+
"use_bidirectional_attention": null,
|
| 117 |
+
"use_cache": true,
|
| 118 |
+
"use_double_wide_mlp": true,
|
| 119 |
+
"vocab_size": 262144,
|
| 120 |
+
"vocab_size_per_layer_input": 262144
|
| 121 |
+
},
|
| 122 |
+
"tie_word_embeddings": true,
|
| 123 |
+
"transformers_version": "5.20.1",
|
| 124 |
+
"use_cache": false,
|
| 125 |
+
"video_token_id": 258884,
|
| 126 |
+
"vision_config": null,
|
| 127 |
+
"vision_soft_tokens_per_image": 280,
|
| 128 |
+
"torch_dtype": "bfloat16"
|
| 129 |
+
}
|