Update app.py
Browse files
app.py
CHANGED
|
@@ -310,7 +310,7 @@ def parse_investigation(data: Dict[str, Any], images: List[str], face_images: Li
|
|
| 310 |
# Gradio app
|
| 311 |
def gradio_app(prompts_text, system_message, user_message, temperature):
|
| 312 |
# Split prompts by commas and strip whitespace
|
| 313 |
-
prompts = [p.strip() for p in prompts_text.split('
|
| 314 |
images = ["http://example.com/image1.jpg", "http://example.com/image2.jpg"]
|
| 315 |
face_images = ["http://example.com/face1.jpg"]
|
| 316 |
|
|
@@ -324,6 +324,7 @@ def gradio_app(prompts_text, system_message, user_message, temperature):
|
|
| 324 |
user_message=user_message if user_message else None,
|
| 325 |
temperature=temperature if temperature else 0.0
|
| 326 |
)
|
|
|
|
| 327 |
if investigation_dict:
|
| 328 |
results.append(json.dumps(investigation_dict, indent=4))
|
| 329 |
else:
|
|
@@ -333,7 +334,7 @@ def gradio_app(prompts_text, system_message, user_message, temperature):
|
|
| 333 |
|
| 334 |
if __name__ == "__main__":
|
| 335 |
# Default values
|
| 336 |
-
default_prompts = "
|
| 337 |
"A red sports car with a license plate reading 'FAST123'.",
|
| 338 |
"An elderly woman wearing a green dress and a pearl necklace.",
|
| 339 |
"A cyclist in a yellow jersey riding a blue bicycle.",
|
|
@@ -365,4 +366,4 @@ if __name__ == "__main__":
|
|
| 365 |
)
|
| 366 |
|
| 367 |
# Launch the app
|
| 368 |
-
iface.launch()
|
|
|
|
| 310 |
# Gradio app
|
| 311 |
def gradio_app(prompts_text, system_message, user_message, temperature):
|
| 312 |
# Split prompts by commas and strip whitespace
|
| 313 |
+
prompts = [p.strip() for p in prompts_text.split('\n') if p.strip()]
|
| 314 |
images = ["http://example.com/image1.jpg", "http://example.com/image2.jpg"]
|
| 315 |
face_images = ["http://example.com/face1.jpg"]
|
| 316 |
|
|
|
|
| 324 |
user_message=user_message if user_message else None,
|
| 325 |
temperature=temperature if temperature else 0.0
|
| 326 |
)
|
| 327 |
+
results.append(f'{p}\n')
|
| 328 |
if investigation_dict:
|
| 329 |
results.append(json.dumps(investigation_dict, indent=4))
|
| 330 |
else:
|
|
|
|
| 334 |
|
| 335 |
if __name__ == "__main__":
|
| 336 |
# Default values
|
| 337 |
+
default_prompts = "\n".join([
|
| 338 |
"A red sports car with a license plate reading 'FAST123'.",
|
| 339 |
"An elderly woman wearing a green dress and a pearl necklace.",
|
| 340 |
"A cyclist in a yellow jersey riding a blue bicycle.",
|
|
|
|
| 366 |
)
|
| 367 |
|
| 368 |
# Launch the app
|
| 369 |
+
iface.launch()
|