Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -197,32 +197,20 @@ def chat_interface(question: str, history: List[Tuple[str, str]]):
|
|
| 197 |
response = generate_response(question)
|
| 198 |
return "", history + [(question, response)]
|
| 199 |
|
| 200 |
-
with gr.Blocks(title="AskNature
|
| 201 |
-
gr.Markdown(""
|
| 202 |
-
# 🍃 AskNature BioDialogue """)
|
| 203 |
-
|
| 204 |
with gr.Row():
|
| 205 |
-
chatbot = gr.Chatbot(
|
| 206 |
-
label="Organism Strategy Dialogue",
|
| 207 |
-
height=500,
|
| 208 |
-
bubble_full_width=False,
|
| 209 |
-
avatar_images=("🧬", "🌐") # DNA + Earth icons
|
| 210 |
-
)
|
| 211 |
-
|
| 212 |
with gr.Row():
|
| 213 |
-
question = gr.Textbox(
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
scale=4
|
| 217 |
-
)
|
| 218 |
-
clear_btn = gr.Button("🌱 New Exploration Thread", variant="secondary")
|
| 219 |
-
|
| 220 |
-
gr.Markdown("""
|
| 221 |
-
<div style="text-align: center; color: #4a7c59;">
|
| 222 |
-
<small>Powered by AskNature's Database |
|
| 223 |
-
Explore nature's blueprints at <a href="https://asknature.org">asknature.org</a></small>
|
| 224 |
-
</div>""")
|
| 225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
question.submit(chat_interface, [question, chatbot], [question, chatbot])
|
| 227 |
clear_btn.click(lambda: [], None, chatbot)
|
| 228 |
|
|
|
|
| 197 |
response = generate_response(question)
|
| 198 |
return "", history + [(question, response)]
|
| 199 |
|
| 200 |
+
with gr.Blocks(title="AskNature BioRAG Expert", theme=gr.themes.Soft()) as demo:
|
| 201 |
+
gr.Markdown("# 🌿 AskNature RAG-based Chatbot ")
|
|
|
|
|
|
|
| 202 |
with gr.Row():
|
| 203 |
+
chatbot = gr.Chatbot(label="Dialogue History", height=500)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
with gr.Row():
|
| 205 |
+
question = gr.Textbox(placeholder="Ask about biomimicry (e.g. 'How does Werewool use coral proteins to make fibers?')",
|
| 206 |
+
label="Inquiry", scale=4)
|
| 207 |
+
clear_btn = gr.Button("Clear History", variant="secondary")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
|
| 209 |
+
gr.Markdown("""
|
| 210 |
+
<div style="text-align: center; color: #4a7c59;">
|
| 211 |
+
<small>Powered by AskNature's Database |
|
| 212 |
+
Explore nature's blueprints at <a href="https://asknature.org">asknature.org</a></small>
|
| 213 |
+
</div>""")
|
| 214 |
question.submit(chat_interface, [question, chatbot], [question, chatbot])
|
| 215 |
clear_btn.click(lambda: [], None, chatbot)
|
| 216 |
|