Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -26,19 +26,19 @@ def answer_questions(image_tuples, prompt_text):
|
|
26 |
Q_and_A = ""
|
27 |
prompts = [p.strip() for p in prompt_text.split(',')]
|
28 |
image_embeds = [img[0] for img in image_tuples if img[0] is not None]
|
|
|
29 |
|
30 |
for prompt in prompts:
|
31 |
-
answers = []
|
32 |
thread = Thread(
|
33 |
image_answers = moondream.batch_answer(
|
34 |
images=[img.convert("RGB") for img in image_embeds],
|
35 |
prompts=[prompt] * len(image_embeds),
|
36 |
tokenizer=tokenizer
|
37 |
)
|
|
|
38 |
answers.append(image_answers)
|
39 |
)
|
40 |
-
|
41 |
-
thread.start()
|
42 |
|
43 |
for i, prompt in enumerate(prompts):
|
44 |
Q_and_A += f"### Q: {prompt}\n"
|
|
|
26 |
Q_and_A = ""
|
27 |
prompts = [p.strip() for p in prompt_text.split(',')]
|
28 |
image_embeds = [img[0] for img in image_tuples if img[0] is not None]
|
29 |
+
answers = []
|
30 |
|
31 |
for prompt in prompts:
|
|
|
32 |
thread = Thread(
|
33 |
image_answers = moondream.batch_answer(
|
34 |
images=[img.convert("RGB") for img in image_embeds],
|
35 |
prompts=[prompt] * len(image_embeds),
|
36 |
tokenizer=tokenizer
|
37 |
)
|
38 |
+
|
39 |
answers.append(image_answers)
|
40 |
)
|
41 |
+
thread.start()
|
|
|
42 |
|
43 |
for i, prompt in enumerate(prompts):
|
44 |
Q_and_A += f"### Q: {prompt}\n"
|