Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -61,7 +61,7 @@ def extract_frames(frame):
|
|
61 |
|
62 |
return image_bgr
|
63 |
|
64 |
-
def predict_answer(image,
|
65 |
|
66 |
text = f"A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: <image>\n{question}? ASSISTANT:"
|
67 |
input_ids = tokenizer(text, return_tensors='pt').input_ids.to(device)
|
@@ -153,8 +153,8 @@ test_examples = [[None, "Images/cat_dog.jpeg", promt_cat_dog],
|
|
153 |
["videos/v3.mp4",None,promt_video]]
|
154 |
|
155 |
|
156 |
-
def gradio_predict(image,
|
157 |
-
answer = predict_answer(image,
|
158 |
return answer
|
159 |
|
160 |
css = """
|
|
|
61 |
|
62 |
return image_bgr
|
63 |
|
64 |
+
def predict_answer(video,image, question):
|
65 |
|
66 |
text = f"A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: <image>\n{question}? ASSISTANT:"
|
67 |
input_ids = tokenizer(text, return_tensors='pt').input_ids.to(device)
|
|
|
153 |
["videos/v3.mp4",None,promt_video]]
|
154 |
|
155 |
|
156 |
+
def gradio_predict(video,image, question):
|
157 |
+
answer = predict_answer(video,image, question)
|
158 |
return answer
|
159 |
|
160 |
css = """
|