Image-Text-to-Text
Transformers
Safetensors
English
vision-encoder-decoder
text-generation
text-to-text
image-text-to-image-text
conversational
Instructions to use LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project") 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 AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project") model = AutoModelForCausalLM.from_pretrained("LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project", "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/LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project
- SGLang
How to use LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project 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 "LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project" \ --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": "LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project", "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 "LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project" \ --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": "LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project", "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 LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project with Docker Model Runner:
docker model run hf.co/LeroyDyer/SpydazWeb_VisonEncoderDecoder_Project
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,17 +12,33 @@ pipeline_tag: image-text-to-text
|
|
| 12 |
|
| 13 |
# LeroyDyer/Mixtral_AI_Cyber_Q_Vision
|
| 14 |
|
| 15 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
### Model Description
|
| 22 |
|
| 23 |
-
<!-- Provide a longer summary of what this model is. -->
|
| 24 |
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
- **Developed by:** [LeroyDyer]
|
| 28 |
- **Model type:** [image-text-to-image-text]
|
|
@@ -32,11 +48,6 @@ This is the model card of a 🤗 transformers model that has been pushed on the
|
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
-
### Recommendations
|
| 36 |
-
|
| 37 |
-
this is an experiment in vision - the model has been created as a mistral/VisionEncoder/Decoder
|
| 38 |
-
Customized from Mixtral_AI_Cyber_Matrix_2.0(7b) & TinyMistral (248)
|
| 39 |
-
ikim-uk-essen/BiomedCLIP_ViT_patch16_224
|
| 40 |
|
| 41 |
## How to Get Started with the Model
|
| 42 |
|
|
|
|
| 12 |
|
| 13 |
# LeroyDyer/Mixtral_AI_Cyber_Q_Vision
|
| 14 |
|
|
|
|
| 15 |
|
| 16 |
+
VisionEncoderDecoderModel is a generic model class that will be instantiated as a transformer architecture
|
| 17 |
+
with one of the base vision model classes of the library as encoder and another one as decoder
|
| 18 |
+
when created with the :
|
| 19 |
+
|
| 20 |
+
```python
|
| 21 |
+
|
| 22 |
+
transformers.AutoModel.from_pretrained class method for the encoder and :
|
| 23 |
+
transformers.AutoModelForCausalLM.from_pretrained class method for the decoder.
|
| 24 |
|
| 25 |
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
### Model Description
|
| 29 |
|
|
|
|
| 30 |
|
| 31 |
+
|
| 32 |
+
This is the model card of a 🤗 transformers model that has been pushed on the Hub.
|
| 33 |
+
|
| 34 |
+
This is an experiment in vision - the model has been created as a mistral/VisionEncoder/Decoder
|
| 35 |
+
|
| 36 |
+
Customized from
|
| 37 |
+
-Mixtral_AI_Cyber_Matrix_2.0(7b)
|
| 38 |
+
|
| 39 |
+
-TinyMistral (248)
|
| 40 |
+
|
| 41 |
+
-ikim-uk-essen/BiomedCLIP_ViT_patch16_224
|
| 42 |
|
| 43 |
- **Developed by:** [LeroyDyer]
|
| 44 |
- **Model type:** [image-text-to-image-text]
|
|
|
|
| 48 |
|
| 49 |
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
## How to Get Started with the Model
|
| 53 |
|