Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,8 @@ llm = Llama(
|
|
| 19 |
history = []
|
| 20 |
|
| 21 |
system_message = """
|
| 22 |
-
You are a helpful
|
|
|
|
| 23 |
# The rest of the system message
|
| 24 |
|
| 25 |
# Load the Vision Model
|
|
@@ -72,7 +73,7 @@ def predict(img):
|
|
| 72 |
message += f"- {bird}: {prob:.2%}\n"
|
| 73 |
|
| 74 |
# Generate responses using LLM
|
| 75 |
-
responses = generate_text(message, history)
|
| 76 |
|
| 77 |
return {"bird_predictions": bird_predictions, "llm_responses": responses}
|
| 78 |
|
|
@@ -84,11 +85,11 @@ enable_queue = True
|
|
| 84 |
|
| 85 |
gr.Interface(
|
| 86 |
fn=predict,
|
| 87 |
-
inputs=gr.inputs.Image(
|
| 88 |
-
outputs=
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
title=title,
|
| 93 |
description=description,
|
| 94 |
examples=examples,
|
|
|
|
| 19 |
history = []
|
| 20 |
|
| 21 |
system_message = """
|
| 22 |
+
You are a helpful, Bird researcher. you know alot about birds
|
| 23 |
+
"""
|
| 24 |
# The rest of the system message
|
| 25 |
|
| 26 |
# Load the Vision Model
|
|
|
|
| 73 |
message += f"- {bird}: {prob:.2%}\n"
|
| 74 |
|
| 75 |
# Generate responses using LLM
|
| 76 |
+
responses = list(generate_text(message, history))
|
| 77 |
|
| 78 |
return {"bird_predictions": bird_predictions, "llm_responses": responses}
|
| 79 |
|
|
|
|
| 85 |
|
| 86 |
gr.Interface(
|
| 87 |
fn=predict,
|
| 88 |
+
inputs=gr.inputs.Image(),
|
| 89 |
+
outputs=[
|
| 90 |
+
gr.outputs.Data(type="dictionary", label="Bird Predictions"),
|
| 91 |
+
gr.outputs.Textbox(label="LLM Responses")
|
| 92 |
+
],
|
| 93 |
title=title,
|
| 94 |
description=description,
|
| 95 |
examples=examples,
|