Image-Text-to-Text
Transformers
Safetensors
English
mistral
text-generation
4-bit precision
AWQ
vision
conversational
text-generation-inference
awq
Instructions to use solidrust/Mixtral_AI_MiniTronVision-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use solidrust/Mixtral_AI_MiniTronVision-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="solidrust/Mixtral_AI_MiniTronVision-AWQ") 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 AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("solidrust/Mixtral_AI_MiniTronVision-AWQ") model = AutoModelForCausalLM.from_pretrained("solidrust/Mixtral_AI_MiniTronVision-AWQ", 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 = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use solidrust/Mixtral_AI_MiniTronVision-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "solidrust/Mixtral_AI_MiniTronVision-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "solidrust/Mixtral_AI_MiniTronVision-AWQ", "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/solidrust/Mixtral_AI_MiniTronVision-AWQ
- SGLang
How to use solidrust/Mixtral_AI_MiniTronVision-AWQ 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 "solidrust/Mixtral_AI_MiniTronVision-AWQ" \ --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": "solidrust/Mixtral_AI_MiniTronVision-AWQ", "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 "solidrust/Mixtral_AI_MiniTronVision-AWQ" \ --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": "solidrust/Mixtral_AI_MiniTronVision-AWQ", "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 solidrust/Mixtral_AI_MiniTronVision-AWQ with Docker Model Runner:
docker model run hf.co/solidrust/Mixtral_AI_MiniTronVision-AWQ
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
| 2 |
library_name: transformers
|
| 3 |
tags:
|
| 4 |
- 4-bit
|
|
@@ -6,10 +8,39 @@ tags:
|
|
| 6 |
- text-generation
|
| 7 |
- autotrain_compatible
|
| 8 |
- endpoints_compatible
|
| 9 |
-
|
|
|
|
| 10 |
inference: false
|
| 11 |
quantized_by: Suparious
|
| 12 |
---
|
| 13 |
#
|
| 14 |
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
library_name: transformers
|
| 5 |
tags:
|
| 6 |
- 4-bit
|
|
|
|
| 8 |
- text-generation
|
| 9 |
- autotrain_compatible
|
| 10 |
- endpoints_compatible
|
| 11 |
+
- vision
|
| 12 |
+
pipeline_tag: image-text-to-text
|
| 13 |
inference: false
|
| 14 |
quantized_by: Suparious
|
| 15 |
---
|
| 16 |
#
|
| 17 |
|
| 18 |
+
## Model Summary
|
| 19 |
+
|
| 20 |
+
# ADD HEAD
|
| 21 |
+
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
print('Add Vision...')
|
| 27 |
+
# ADD HEAD
|
| 28 |
+
# Combine pre-trained encoder and pre-trained decoder to form a Seq2Seq model
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
Vmodel = VisionEncoderDecoderModel.from_encoder_decoder_pretrained(
|
| 33 |
+
"google/vit-base-patch16-224-in21k", "LeroyDyer/Mixtral_AI_Tiny"
|
| 34 |
+
)
|
| 35 |
+
_Encoder_ImageProcessor = Vmodel.encoder
|
| 36 |
+
_Decoder_ImageTokenizer = Vmodel.decoder
|
| 37 |
+
_VisionEncoderDecoderModel = Vmodel
|
| 38 |
+
# Add Pad tokems
|
| 39 |
+
LM_MODEL.VisionEncoderDecoder = _VisionEncoderDecoderModel
|
| 40 |
+
# Add Sub Components
|
| 41 |
+
LM_MODEL.Encoder_ImageProcessor = _Encoder_ImageProcessor
|
| 42 |
+
LM_MODEL.Decoder_ImageTokenizer = _Decoder_ImageTokenizer
|
| 43 |
+
LM_MODEL
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
```
|