Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ import requests
|
|
| 5 |
from PIL import Image
|
| 6 |
from io import BytesIO
|
| 7 |
|
| 8 |
-
# π Groq API Key (Set via environment variable or manually for testing)
|
| 9 |
GROQ_API_KEY = os.getenv("GROQ_API_KEY") or "PASTE_YOUR_GROQ_API_KEY_HERE"
|
| 10 |
|
| 11 |
# β
Groq model info
|
|
@@ -74,7 +74,7 @@ def reset_history():
|
|
| 74 |
history = []
|
| 75 |
return "", ""
|
| 76 |
|
| 77 |
-
# π Gradio GUI
|
| 78 |
with gr.Blocks(theme=gr.themes.Soft(), css=".gradio-container { max-width: 950px; margin: auto; }") as demo:
|
| 79 |
gr.Markdown("## ποΈ Construction Damage Identifier Chatbot")
|
| 80 |
gr.Markdown(
|
|
@@ -84,10 +84,10 @@ with gr.Blocks(theme=gr.themes.Soft(), css=".gradio-container { max-width: 950px
|
|
| 84 |
|
| 85 |
with gr.Row():
|
| 86 |
with gr.Column(scale=1):
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
)
|
| 92 |
prompt_input = gr.Textbox(
|
| 93 |
lines=3,
|
|
|
|
| 5 |
from PIL import Image
|
| 6 |
from io import BytesIO
|
| 7 |
|
| 8 |
+
# π Groq API Key (Set via environment variable or paste manually for local testing)
|
| 9 |
GROQ_API_KEY = os.getenv("GROQ_API_KEY") or "PASTE_YOUR_GROQ_API_KEY_HERE"
|
| 10 |
|
| 11 |
# β
Groq model info
|
|
|
|
| 74 |
history = []
|
| 75 |
return "", ""
|
| 76 |
|
| 77 |
+
# π Gradio GUI
|
| 78 |
with gr.Blocks(theme=gr.themes.Soft(), css=".gradio-container { max-width: 950px; margin: auto; }") as demo:
|
| 79 |
gr.Markdown("## ποΈ Construction Damage Identifier Chatbot")
|
| 80 |
gr.Markdown(
|
|
|
|
| 84 |
|
| 85 |
with gr.Row():
|
| 86 |
with gr.Column(scale=1):
|
| 87 |
+
img_input = gr.Image(
|
| 88 |
+
type="pil",
|
| 89 |
+
label="πΌοΈ Upload Image of Damage",
|
| 90 |
+
height=300
|
| 91 |
)
|
| 92 |
prompt_input = gr.Textbox(
|
| 93 |
lines=3,
|