Instructions to use katuni4ka/tiny-random-llama-4-8E with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use katuni4ka/tiny-random-llama-4-8E with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="katuni4ka/tiny-random-llama-4-8E") 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)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("katuni4ka/tiny-random-llama-4-8E") model = AutoModelForImageTextToText.from_pretrained("katuni4ka/tiny-random-llama-4-8E") 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use katuni4ka/tiny-random-llama-4-8E with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "katuni4ka/tiny-random-llama-4-8E" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "katuni4ka/tiny-random-llama-4-8E", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/katuni4ka/tiny-random-llama-4-8E
- SGLang
How to use katuni4ka/tiny-random-llama-4-8E 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 "katuni4ka/tiny-random-llama-4-8E" \ --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": "katuni4ka/tiny-random-llama-4-8E", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "katuni4ka/tiny-random-llama-4-8E" \ --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": "katuni4ka/tiny-random-llama-4-8E", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use katuni4ka/tiny-random-llama-4-8E with Docker Model Runner:
docker model run hf.co/katuni4ka/tiny-random-llama-4-8E
Upload 10 files
Browse files- config.json +2 -2
- generation_config.json +1 -1
- model.safetensors +1 -1
config.json
CHANGED
|
@@ -59,7 +59,7 @@
|
|
| 59 |
},
|
| 60 |
"tie_word_embeddings": false,
|
| 61 |
"torch_dtype": "float32",
|
| 62 |
-
"transformers_version": "4.
|
| 63 |
"vision_config": {
|
| 64 |
"_attn_implementation_autoset": true,
|
| 65 |
"attention_dropout": 0.0,
|
|
@@ -70,7 +70,6 @@
|
|
| 70 |
"intermediate_size": 128,
|
| 71 |
"model_type": "llama4_vision_model",
|
| 72 |
"multi_modal_projector_bias": false,
|
| 73 |
-
"torch_dtype": "float32",
|
| 74 |
"norm_eps": 1e-05,
|
| 75 |
"num_attention_heads": 2,
|
| 76 |
"num_channels": 3,
|
|
@@ -81,6 +80,7 @@
|
|
| 81 |
"projector_input_dim": 32,
|
| 82 |
"projector_output_dim": 32,
|
| 83 |
"rope_theta": 10000,
|
|
|
|
| 84 |
"vision_feature_layer": -1,
|
| 85 |
"vision_feature_select_strategy": "default",
|
| 86 |
"vision_output_dim": 32
|
|
|
|
| 59 |
},
|
| 60 |
"tie_word_embeddings": false,
|
| 61 |
"torch_dtype": "float32",
|
| 62 |
+
"transformers_version": "4.51.3",
|
| 63 |
"vision_config": {
|
| 64 |
"_attn_implementation_autoset": true,
|
| 65 |
"attention_dropout": 0.0,
|
|
|
|
| 70 |
"intermediate_size": 128,
|
| 71 |
"model_type": "llama4_vision_model",
|
| 72 |
"multi_modal_projector_bias": false,
|
|
|
|
| 73 |
"norm_eps": 1e-05,
|
| 74 |
"num_attention_heads": 2,
|
| 75 |
"num_channels": 3,
|
|
|
|
| 80 |
"projector_input_dim": 32,
|
| 81 |
"projector_output_dim": 32,
|
| 82 |
"rope_theta": 10000,
|
| 83 |
+
"torch_dtype": "float32",
|
| 84 |
"vision_feature_layer": -1,
|
| 85 |
"vision_feature_select_strategy": "default",
|
| 86 |
"vision_output_dim": 32
|
generation_config.json
CHANGED
|
@@ -7,5 +7,5 @@
|
|
| 7 |
200008
|
| 8 |
],
|
| 9 |
"pad_token_id": 200018,
|
| 10 |
-
"transformers_version": "4.
|
| 11 |
}
|
|
|
|
| 7 |
200008
|
| 8 |
],
|
| 9 |
"pad_token_id": 200018,
|
| 10 |
+
"transformers_version": "4.51.3"
|
| 11 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 52685712
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a8f069e403b6d053b3aa8e4e41ee17d77bcddd198f7c005c8f195de6337219c5
|
| 3 |
size 52685712
|