Spaces:
Sleeping
Sleeping
Commit ·
d420af1
1
Parent(s): e11f585
cosmatic changes
Browse files
app.py
CHANGED
|
@@ -60,9 +60,8 @@ def predict(message, history):
|
|
| 60 |
except Exception as e:
|
| 61 |
yield f"⚠️ System Error: {str(e)}"
|
| 62 |
|
| 63 |
-
# ---
|
| 64 |
-
|
| 65 |
-
with gr.Blocks(theme=gr.themes.Soft(primary_hue="indigo", secondary_hue="slate")) as demo:
|
| 66 |
gr.ChatInterface(
|
| 67 |
fn=predict,
|
| 68 |
title="⚡ SimpleAI-259M",
|
|
@@ -72,9 +71,13 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="indigo", secondary_hue="slate")
|
|
| 72 |
"Write a Python function to calculate the area of a circle.",
|
| 73 |
"Which part of a plant is usually responsible for making food using sunlight?",
|
| 74 |
"What is the capital of France?"
|
| 75 |
-
]
|
| 76 |
-
type="messages"
|
| 77 |
)
|
| 78 |
|
| 79 |
if __name__ == "__main__":
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
except Exception as e:
|
| 61 |
yield f"⚠️ System Error: {str(e)}"
|
| 62 |
|
| 63 |
+
# --- UI Customization for Gradio 6.0 ---
|
| 64 |
+
with gr.Blocks() as demo:
|
|
|
|
| 65 |
gr.ChatInterface(
|
| 66 |
fn=predict,
|
| 67 |
title="⚡ SimpleAI-259M",
|
|
|
|
| 71 |
"Write a Python function to calculate the area of a circle.",
|
| 72 |
"Which part of a plant is usually responsible for making food using sunlight?",
|
| 73 |
"What is the capital of France?"
|
| 74 |
+
]
|
|
|
|
| 75 |
)
|
| 76 |
|
| 77 |
if __name__ == "__main__":
|
| 78 |
+
# Moved 'theme' here as requested by the Gradio 6.0 Warning
|
| 79 |
+
demo.launch(
|
| 80 |
+
server_name="0.0.0.0",
|
| 81 |
+
server_port=7860,
|
| 82 |
+
theme=gr.themes.Soft(primary_hue="indigo", secondary_hue="slate")
|
| 83 |
+
)
|