Spaces:
Runtime error
Runtime error
Commit ·
0d55045
1
Parent(s): 7a513d5
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,7 +36,7 @@ def get_completion(image):
|
|
| 36 |
inputs = processor(raw_image, text, return_tensors="pt")
|
| 37 |
|
| 38 |
out = model.generate(**inputs)
|
| 39 |
-
return processor.decode(out[0], skip_special_tokens=True)
|
| 40 |
|
| 41 |
|
| 42 |
# headers = {
|
|
@@ -53,14 +53,6 @@ def get_completion(image):
|
|
| 53 |
# return json.loads(response.content.decode("utf-8"))
|
| 54 |
|
| 55 |
|
| 56 |
-
#demo = gr.Interface(
|
| 57 |
-
# fn=get_completion,
|
| 58 |
-
# inputs="text",
|
| 59 |
-
# outputs="text"
|
| 60 |
-
#)
|
| 61 |
-
|
| 62 |
-
#image_url = "https://free-images.com/sm/9596/dog_animal_greyhound_983023.jpg"
|
| 63 |
-
#demo = gr.get_completion(image_url)
|
| 64 |
|
| 65 |
|
| 66 |
gr.close_all()
|
|
|
|
| 36 |
inputs = processor(raw_image, text, return_tensors="pt")
|
| 37 |
|
| 38 |
out = model.generate(**inputs)
|
| 39 |
+
return json.loads(processor.decode(out[0], skip_special_tokens=True))
|
| 40 |
|
| 41 |
|
| 42 |
# headers = {
|
|
|
|
| 53 |
# return json.loads(response.content.decode("utf-8"))
|
| 54 |
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
|
| 58 |
gr.close_all()
|