Image-Text-to-Text
Transformers
Safetensors
English
qwen2_vl
text-generation-inference
unsloth
conversational
Instructions to use lrsrthnbch/q2vl7b_f02 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lrsrthnbch/q2vl7b_f02 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="lrsrthnbch/q2vl7b_f02") 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("lrsrthnbch/q2vl7b_f02") model = AutoModelForImageTextToText.from_pretrained("lrsrthnbch/q2vl7b_f02") 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 Settings
- vLLM
How to use lrsrthnbch/q2vl7b_f02 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lrsrthnbch/q2vl7b_f02" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lrsrthnbch/q2vl7b_f02", "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/lrsrthnbch/q2vl7b_f02
- SGLang
How to use lrsrthnbch/q2vl7b_f02 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 "lrsrthnbch/q2vl7b_f02" \ --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": "lrsrthnbch/q2vl7b_f02", "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 "lrsrthnbch/q2vl7b_f02" \ --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": "lrsrthnbch/q2vl7b_f02", "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 Studio
How to use lrsrthnbch/q2vl7b_f02 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for lrsrthnbch/q2vl7b_f02 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for lrsrthnbch/q2vl7b_f02 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for lrsrthnbch/q2vl7b_f02 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="lrsrthnbch/q2vl7b_f02", max_seq_length=2048, ) - Docker Model Runner
How to use lrsrthnbch/q2vl7b_f02 with Docker Model Runner:
docker model run hf.co/lrsrthnbch/q2vl7b_f02
Upload 11 files
Browse files- .gitattributes +11 -0
- IMG_0062.MOV +3 -0
- IMG_0069.MOV +3 -0
- IMG_0071.MOV +3 -0
- IMG_0075.MOV +3 -0
- IMG_0077.MOV +3 -0
- IMG_0079.MOV +3 -0
- IMG_0083.MOV +3 -0
- IMG_0084.MOV +3 -0
- IMG_0085.MOV +3 -0
- IMG_0086.MOV +3 -0
- IMG_0091.MOV +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,14 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
IMG_0062.MOV filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
IMG_0069.MOV filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
IMG_0071.MOV filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
IMG_0075.MOV filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
IMG_0077.MOV filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
IMG_0079.MOV filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
IMG_0083.MOV filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
IMG_0084.MOV filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
IMG_0085.MOV filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
IMG_0086.MOV filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
IMG_0091.MOV filter=lfs diff=lfs merge=lfs -text
|
IMG_0062.MOV
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ed50d5886b3990683d4ca79cd398f3fef0a9d703328c900620a537bea160e6b5
|
| 3 |
+
size 27683588
|
IMG_0069.MOV
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bf40ed8579483366efc83631ed871e9713a9fda81f17786682f365b7b9ebd0b4
|
| 3 |
+
size 20377059
|
IMG_0071.MOV
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f5851744924fe9b4005498e2ccee6bca17b258d71ce2e8f6311d5919cd432b28
|
| 3 |
+
size 13398722
|
IMG_0075.MOV
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:41b584ce3135d0aff3280c9756fb888004a7c771e68e91fa0d99624bf165a9ee
|
| 3 |
+
size 11826783
|
IMG_0077.MOV
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4706a0a7859d79bd05e0c5ead7378d7c2e5b2aabb7bc882df516d1bbc41eba12
|
| 3 |
+
size 13279209
|
IMG_0079.MOV
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8535eddc4b34495c9dbed5e8c52b0b52b3f3dc43cff4954846d12dcac6c2e069
|
| 3 |
+
size 10940553
|
IMG_0083.MOV
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4f4e9c56a3f5e519035939b12bd11674a7b5fdeaf3b599e5332f5c9344e01786
|
| 3 |
+
size 14595818
|
IMG_0084.MOV
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f01569f26c98afe3ade6c79f37bb265a7efa5d6c443f91c653cb967ab3963e57
|
| 3 |
+
size 19402424
|
IMG_0085.MOV
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8c60fa8f70262ec0a63380961eeb6113f71acf371071bfeb8bf44b6e2d4e3045
|
| 3 |
+
size 12430725
|
IMG_0086.MOV
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f42b14c02581966e36d6c30d0c2aa2ac2bb4d62b76775126df00674efffd4c4
|
| 3 |
+
size 13540397
|
IMG_0091.MOV
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d1dea0ba73f918c3cd67828b92fbe92c1503872e21158703cb433c939e07a759
|
| 3 |
+
size 15959997
|