Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -46,8 +46,16 @@ def chat_with_groq(user_input):
|
|
46 |
else:
|
47 |
return f"Error: {response.json()}"
|
48 |
|
49 |
-
# Build Gradio interface with better layout
|
50 |
-
with gr.Blocks(title="Materials Science Expert Chatbot"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
gr.Markdown("## 🧪 Materials Science Expert\nAsk about the best materials for any engineering or industrial application.")
|
52 |
|
53 |
with gr.Row():
|
@@ -60,7 +68,6 @@ with gr.Blocks(title="Materials Science Expert Chatbot") as demo:
|
|
60 |
with gr.Column(scale=1, min_width=100):
|
61 |
submit_btn = gr.Button("Submit", variant="primary", elem_id="orange-btn")
|
62 |
|
63 |
-
# Popular questions
|
64 |
gr.Markdown("#### 📌 Popular Materials Science related questions")
|
65 |
gr.Markdown("""
|
66 |
- What are the best corrosion-resistant materials for marine environments (e.g., desalination)?
|
@@ -74,16 +81,6 @@ with gr.Blocks(title="Materials Science Expert Chatbot") as demo:
|
|
74 |
|
75 |
submit_btn.click(chat_with_groq, inputs=user_input, outputs=output)
|
76 |
|
77 |
-
gr.CSS("""
|
78 |
-
#orange-btn {
|
79 |
-
background-color: #f97316 !important;
|
80 |
-
color: white !important;
|
81 |
-
border: none;
|
82 |
-
font-weight: bold;
|
83 |
-
}
|
84 |
-
""")
|
85 |
-
|
86 |
-
|
87 |
# Launch the app
|
88 |
if __name__ == "__main__":
|
89 |
demo.launch()
|
|
|
46 |
else:
|
47 |
return f"Error: {response.json()}"
|
48 |
|
49 |
+
# Build Gradio interface with better layout and custom styling
|
50 |
+
with gr.Blocks(title="Materials Science Expert Chatbot", css="""
|
51 |
+
#orange-btn {
|
52 |
+
background-color: #f97316 !important;
|
53 |
+
color: white !important;
|
54 |
+
border: none;
|
55 |
+
font-weight: bold;
|
56 |
+
}
|
57 |
+
""") as demo:
|
58 |
+
|
59 |
gr.Markdown("## 🧪 Materials Science Expert\nAsk about the best materials for any engineering or industrial application.")
|
60 |
|
61 |
with gr.Row():
|
|
|
68 |
with gr.Column(scale=1, min_width=100):
|
69 |
submit_btn = gr.Button("Submit", variant="primary", elem_id="orange-btn")
|
70 |
|
|
|
71 |
gr.Markdown("#### 📌 Popular Materials Science related questions")
|
72 |
gr.Markdown("""
|
73 |
- What are the best corrosion-resistant materials for marine environments (e.g., desalination)?
|
|
|
81 |
|
82 |
submit_btn.click(chat_with_groq, inputs=user_input, outputs=output)
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
# Launch the app
|
85 |
if __name__ == "__main__":
|
86 |
demo.launch()
|