Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -139,8 +139,8 @@ def m3(que, image):
|
|
139 |
|
140 |
|
141 |
def m4(que, image):
|
142 |
-
processor3 = Pix2StructProcessor.from_pretrained('google/matcha-plotqa-
|
143 |
-
model3 = Pix2StructForConditionalGeneration.from_pretrained('google/matcha-plotqa-
|
144 |
|
145 |
inputs = processor3(images=image, text=que, return_tensors="pt")
|
146 |
predictions = model3.generate(**inputs, max_new_tokens=512)
|
@@ -158,11 +158,18 @@ def m5(que, image):
|
|
158 |
return processor3.decode(predictions[0], skip_special_tokens=True)
|
159 |
|
160 |
def m6(que, image):
|
161 |
-
model3 = Pix2StructForConditionalGeneration.from_pretrained("google/pix2struct-infographics-vqa-large")
|
162 |
-
processor3 = Pix2StructProcessor.from_pretrained("google/pix2struct-infographics-vqa-large")
|
163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
inputs = processor3(images=image, text=que, return_tensors="pt")
|
165 |
-
predictions = model3.generate(**inputs)
|
166 |
return processor3.decode(predictions[0], skip_special_tokens=True)
|
167 |
|
168 |
|
|
|
139 |
|
140 |
|
141 |
def m4(que, image):
|
142 |
+
processor3 = Pix2StructProcessor.from_pretrained('google/matcha-plotqa-v1')
|
143 |
+
model3 = Pix2StructForConditionalGeneration.from_pretrained('google/matcha-plotqa-v1')
|
144 |
|
145 |
inputs = processor3(images=image, text=que, return_tensors="pt")
|
146 |
predictions = model3.generate(**inputs, max_new_tokens=512)
|
|
|
158 |
return processor3.decode(predictions[0], skip_special_tokens=True)
|
159 |
|
160 |
def m6(que, image):
|
161 |
+
# model3 = Pix2StructForConditionalGeneration.from_pretrained("google/pix2struct-infographics-vqa-large")
|
162 |
+
# processor3 = Pix2StructProcessor.from_pretrained("google/pix2struct-infographics-vqa-large")
|
163 |
|
164 |
+
# inputs = processor3(images=image, text=que, return_tensors="pt")
|
165 |
+
# predictions = model3.generate(**inputs)
|
166 |
+
# return processor3.decode(predictions[0], skip_special_tokens=True)
|
167 |
+
|
168 |
+
processor3 = Pix2StructProcessor.from_pretrained('google/matcha-plotqa-v1')
|
169 |
+
model3 = Pix2StructForConditionalGeneration.from_pretrained('google/matcha-plotqa-v1')
|
170 |
+
|
171 |
inputs = processor3(images=image, text=que, return_tensors="pt")
|
172 |
+
predictions = model3.generate(**inputs, max_new_tokens=512)
|
173 |
return processor3.decode(predictions[0], skip_special_tokens=True)
|
174 |
|
175 |
|