Spaces:
Runtime error
Runtime error
Update multimodal_queries.py
Browse files- multimodal_queries.py +6 -5
multimodal_queries.py
CHANGED
|
@@ -1,12 +1,13 @@
|
|
| 1 |
-
import
|
| 2 |
import base64
|
| 3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 4 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 9 |
-
model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 10 |
|
| 11 |
def input_image_setup(uploaded_file):
|
| 12 |
"""
|
|
|
|
| 1 |
+
import re
|
| 2 |
import base64
|
| 3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 4 |
import gradio as gr
|
| 5 |
+
from PIL import Image
|
| 6 |
+
import io
|
| 7 |
+
from transformers import Owlv2Processor, Owlv2ForObjectDetection
|
| 8 |
|
| 9 |
+
processor = Owlv2Processor.from_pretrained("google/owlv2-large-patch14-finetuned")
|
| 10 |
+
model = Owlv2ForObjectDetection.from_pretrained("google/owlv2-large-patch14-finetuned")
|
|
|
|
|
|
|
| 11 |
|
| 12 |
def input_image_setup(uploaded_file):
|
| 13 |
"""
|