Update app.py (#6)
Browse files- Update app.py (cf6169b08aba710fe3dd3e5a9b9b0a13d174e4b3)
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import spaces
|
| 3 |
-
from transformers import
|
| 4 |
import torch
|
| 5 |
from PIL import Image
|
| 6 |
import subprocess
|
|
@@ -11,7 +11,7 @@ import subprocess
|
|
| 11 |
|
| 12 |
# }
|
| 13 |
models = {
|
| 14 |
-
"Qwen/Qwen2-VL-2B-Instruct":
|
| 15 |
|
| 16 |
}
|
| 17 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import spaces
|
| 3 |
+
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
|
| 4 |
import torch
|
| 5 |
from PIL import Image
|
| 6 |
import subprocess
|
|
|
|
| 11 |
|
| 12 |
# }
|
| 13 |
models = {
|
| 14 |
+
"Qwen/Qwen2-VL-2B-Instruct": Qwen2VLForConditionalGeneration.from_pretrained("Qwen/Qwen2-VL-2B-Instruct", trust_remote_code=True, torch_dtype="auto").cuda().eval()
|
| 15 |
|
| 16 |
}
|
| 17 |
|