Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ import numpy as np
|
|
7 |
import pandas as pd
|
8 |
import ast
|
9 |
from collections import Counter
|
|
|
10 |
|
11 |
|
12 |
# # Ensure GPU usage if available
|
@@ -187,6 +188,10 @@ test_examples = [[None, "Images/cat_dog.jpeg", promt_cat_dog],
|
|
187 |
|
188 |
def gradio_predict(video,image, question):
|
189 |
answer = predict_answer(video,image, question)
|
|
|
|
|
|
|
|
|
190 |
# Convert the DataFrame to CSV
|
191 |
output_buffer = BytesIO()
|
192 |
df.to_csv(answer, index=False)
|
|
|
7 |
import pandas as pd
|
8 |
import ast
|
9 |
from collections import Counter
|
10 |
+
from io import BytesIO
|
11 |
|
12 |
|
13 |
# # Ensure GPU usage if available
|
|
|
188 |
|
189 |
def gradio_predict(video,image, question):
|
190 |
answer = predict_answer(video,image, question)
|
191 |
+
|
192 |
+
# Convert the dictionary to a DataFrame
|
193 |
+
df = pd.DataFrame([answer])
|
194 |
+
|
195 |
# Convert the DataFrame to CSV
|
196 |
output_buffer = BytesIO()
|
197 |
df.to_csv(answer, index=False)
|