Image-Text-to-Text
Transformers
Safetensors
English
mllama
text-generation-inference
unsloth
conversational
4-bit precision
bitsandbytes
Instructions to use Portx/trial with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Portx/trial with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Portx/trial") 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("Portx/trial") model = AutoModelForMultimodalLM.from_pretrained("Portx/trial", 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 Portx/trial with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Portx/trial" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Portx/trial", "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/Portx/trial
- SGLang
How to use Portx/trial 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 "Portx/trial" \ --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": "Portx/trial", "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 "Portx/trial" \ --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": "Portx/trial", "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" } } ] } ] }' - Unsloth Desktop
- Docker Model Runner
How to use Portx/trial with Docker Model Runner:
docker model run hf.co/Portx/trial
Download config.json from Portx/trial: direct link, hf CLI and curl.
- Browser
- Download file 3.46 kB
-
https://huggingface.co/Portx/trial/resolve/main/config.json
- Command line
-
hf download hf://Portx/trial/config.json
-
curl -L -o config.json https://huggingface.co/Portx/trial/resolve/main/config.json
3.46 kB
| { | |
| "architectures": [ | |
| "MllamaForConditionalGeneration" | |
| ], | |
| "image_token_index": 128256, | |
| "model_type": "mllama", | |
| "pad_token_id": 128004, | |
| "quantization_config": { | |
| "bnb_4bit_compute_dtype": "bfloat16", | |
| "bnb_4bit_quant_type": "nf4", | |
| "bnb_4bit_use_double_quant": true, | |
| "llm_int8_enable_fp32_cpu_offload": false, | |
| "llm_int8_has_fp16_weight": false, | |
| "llm_int8_skip_modules": [ | |
| "model.vision_model.transformer.layers.13.mlp.fc2", | |
| "model.language_model.layers.1.self_attn.q_proj", | |
| "model.language_model.layers.1.self_attn.k_proj", | |
| "model.language_model.layers.1.self_attn.v_proj", | |
| "model.language_model.layers.1.self_attn.o_proj", | |
| "model.language_model.layers.1.mlp.gate_proj", | |
| "model.language_model.layers.1.mlp.up_proj", | |
| "model.language_model.layers.1.mlp.down_proj", | |
| "model.language_model.layers.8.cross_attn.o_proj", | |
| "model.language_model.layers.13.cross_attn.o_proj", | |
| "model.language_model.layers.13.mlp.down_proj", | |
| "model.language_model.layers.18.cross_attn.o_proj", | |
| "model.language_model.layers.18.mlp.down_proj", | |
| "model.language_model.layers.23.cross_attn.o_proj", | |
| "model.language_model.layers.28.cross_attn.o_proj", | |
| "model.language_model.layers.33.cross_attn.o_proj", | |
| "model.language_model.layers.38.cross_attn.o_proj", | |
| "model.multi_modal_projector", | |
| "lm_head" | |
| ], | |
| "llm_int8_threshold": 6.0, | |
| "load_in_4bit": true, | |
| "load_in_8bit": false, | |
| "quant_method": "bitsandbytes" | |
| }, | |
| "text_config": { | |
| "_attn_implementation_autoset": false, | |
| "cross_attention_layers": [ | |
| 3, | |
| 8, | |
| 13, | |
| 18, | |
| 23, | |
| 28, | |
| 33, | |
| 38 | |
| ], | |
| "dropout": 0, | |
| "eos_token_id": [ | |
| 128001, | |
| 128008, | |
| 128009 | |
| ], | |
| "hidden_act": "silu", | |
| "hidden_size": 4096, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 14336, | |
| "max_position_embeddings": 131072, | |
| "model_type": "mllama_text_model", | |
| "num_attention_heads": 32, | |
| "num_hidden_layers": 40, | |
| "num_key_value_heads": 8, | |
| "rms_norm_eps": 1e-05, | |
| "rope_scaling": { | |
| "factor": 8.0, | |
| "high_freq_factor": 4.0, | |
| "low_freq_factor": 1.0, | |
| "original_max_position_embeddings": 8192, | |
| "rope_type": "llama3" | |
| }, | |
| "rope_theta": 500000.0, | |
| "torch_dtype": "bfloat16", | |
| "use_cache": true, | |
| "vocab_size": 128256 | |
| }, | |
| "torch_dtype": "bfloat16", | |
| "transformers_version": "4.55.4", | |
| "unsloth_fixed": true, | |
| "unsloth_version": "2025.9.7", | |
| "vision_config": { | |
| "_attn_implementation_autoset": false, | |
| "attention_heads": 16, | |
| "hidden_act": "gelu", | |
| "hidden_size": 1280, | |
| "image_size": 560, | |
| "initializer_range": 0.02, | |
| "intermediate_layers_indices": [ | |
| 3, | |
| 7, | |
| 15, | |
| 23, | |
| 30 | |
| ], | |
| "intermediate_size": 5120, | |
| "max_num_tiles": 4, | |
| "model_type": "mllama_vision_model", | |
| "norm_eps": 1e-05, | |
| "num_channels": 3, | |
| "num_global_layers": 8, | |
| "num_hidden_layers": 32, | |
| "patch_size": 14, | |
| "supported_aspect_ratios": [ | |
| [ | |
| 1, | |
| 1 | |
| ], | |
| [ | |
| 1, | |
| 2 | |
| ], | |
| [ | |
| 1, | |
| 3 | |
| ], | |
| [ | |
| 1, | |
| 4 | |
| ], | |
| [ | |
| 2, | |
| 1 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 3, | |
| 1 | |
| ], | |
| [ | |
| 4, | |
| 1 | |
| ] | |
| ], | |
| "torch_dtype": "bfloat16", | |
| "vision_output_dim": 7680 | |
| } | |
| } | |