Spaces:
Runtime error
Runtime error
miguelcarv
commited on
Commit
•
c40944a
1
Parent(s):
d381d50
added spaces
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import torch
|
|
7 |
from PIL import Image
|
8 |
import os
|
9 |
import requests
|
10 |
-
|
11 |
|
12 |
def get_config(hf_model_path):
|
13 |
config_path = hf_hub_download(hf_model_path, "config.json")
|
@@ -57,7 +57,7 @@ SYSTEM_PROMPT = "You are an AI visual assistant and you are seeing a single imag
|
|
57 |
whiteboard = Image.open(requests.get("https://c1.staticflickr.com/7/6168/6207108414_a8833f410e_o.jpg", stream=True).raw).convert('RGB')
|
58 |
taxi_image = Image.open(requests.get("https://llava.hliu.cc/file=/nobackup/haotian/tmp/gradio/ca10383cc943e99941ecffdc4d34c51afb2da472/extreme_ironing.jpg", stream=True).raw).convert('RGB')
|
59 |
|
60 |
-
|
61 |
def generate_answer(img, question, max_new_tokens, num_beams):
|
62 |
|
63 |
image = [img]
|
|
|
7 |
from PIL import Image
|
8 |
import os
|
9 |
import requests
|
10 |
+
import spaces
|
11 |
|
12 |
def get_config(hf_model_path):
|
13 |
config_path = hf_hub_download(hf_model_path, "config.json")
|
|
|
57 |
whiteboard = Image.open(requests.get("https://c1.staticflickr.com/7/6168/6207108414_a8833f410e_o.jpg", stream=True).raw).convert('RGB')
|
58 |
taxi_image = Image.open(requests.get("https://llava.hliu.cc/file=/nobackup/haotian/tmp/gradio/ca10383cc943e99941ecffdc4d34c51afb2da472/extreme_ironing.jpg", stream=True).raw).convert('RGB')
|
59 |
|
60 |
+
@spaces.GPU
|
61 |
def generate_answer(img, question, max_new_tokens, num_beams):
|
62 |
|
63 |
image = [img]
|