Spaces:
Running
Running
Commit
·
94759d3
1
Parent(s):
ff86b84
Finetune prompt
Browse files
app.py
CHANGED
@@ -154,12 +154,17 @@ async def image_question(file: UploadFile = File(...)):
|
|
154 |
"data": b64
|
155 |
}
|
156 |
}]
|
157 |
-
# Ask Gemini to return JSON
|
158 |
prompt = (
|
159 |
-
"From the screenshot extract
|
160 |
-
"There
|
161 |
-
"
|
162 |
-
"
|
|
|
|
|
|
|
|
|
|
|
163 |
)
|
164 |
# Send prompt and image
|
165 |
text = call_gemini(prompt, vision_part)
|
|
|
154 |
"data": b64
|
155 |
}
|
156 |
}]
|
157 |
+
# Ask Gemini to return JSON splitting Q&A
|
158 |
prompt = (
|
159 |
+
"From the screenshot, extract all English interview question(s). "
|
160 |
+
"There may be multiple questions. For each, provide a concise answer (≤200 words).\n\n"
|
161 |
+
"Return only valid JSON as a list of objects:\n"
|
162 |
+
"[\n"
|
163 |
+
" {\"question\": \"...\", \"answer\": \"...\"},\n"
|
164 |
+
" {\"question\": \"...\", \"answer\": \"...\"},\n"
|
165 |
+
" ...\n"
|
166 |
+
"]\n\n"
|
167 |
+
"Do not include explanations or additional formatting — only output raw JSON."
|
168 |
)
|
169 |
# Send prompt and image
|
170 |
text = call_gemini(prompt, vision_part)
|