Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ import os
|
|
| 7 |
# ----------------------------
|
| 8 |
# Load AI model (reasoning)
|
| 9 |
# ----------------------------
|
| 10 |
-
reasoner = pipeline("text2text-generation", model="google/flan-t5-small")
|
| 11 |
|
| 12 |
# ----------------------------
|
| 13 |
# Points storage (JSON file)
|
|
@@ -58,8 +58,33 @@ def solve_math(problem):
|
|
| 58 |
with gr.Blocks(
|
| 59 |
css="""
|
| 60 |
.gradio-container {
|
| 61 |
-
background: #
|
| 62 |
font-family: 'Nunito', sans-serif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
}
|
| 64 |
.title {
|
| 65 |
color: #4DA6FF;
|
|
@@ -84,11 +109,19 @@ with gr.Blocks(
|
|
| 84 |
"""
|
| 85 |
) as demo:
|
| 86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
# Header with logo + title
|
| 88 |
gr.HTML(
|
| 89 |
"""
|
| 90 |
<div style='text-align:center;'>
|
| 91 |
-
<img src='logo.
|
|
|
|
| 92 |
</div>
|
| 93 |
"""
|
| 94 |
)
|
|
|
|
| 7 |
# ----------------------------
|
| 8 |
# Load AI model (reasoning)
|
| 9 |
# ----------------------------
|
| 10 |
+
reasoner = pipeline("text2text-generation", model="google/flan-t5-small", device=-1)
|
| 11 |
|
| 12 |
# ----------------------------
|
| 13 |
# Points storage (JSON file)
|
|
|
|
| 58 |
with gr.Blocks(
|
| 59 |
css="""
|
| 60 |
.gradio-container {
|
| 61 |
+
background: linear-gradient(135deg, #f9f7ff 0%, #e1f5fe 100%);
|
| 62 |
font-family: 'Nunito', sans-serif;
|
| 63 |
+
position: relative;
|
| 64 |
+
overflow: hidden;
|
| 65 |
+
}
|
| 66 |
+
.gradio-container::before {
|
| 67 |
+
content: "➕ ➖ ✖️ ➗";
|
| 68 |
+
font-size: 4em;
|
| 69 |
+
color: rgba(255, 255, 255, 0.2);
|
| 70 |
+
position: absolute;
|
| 71 |
+
top: 10%;
|
| 72 |
+
left: 5%;
|
| 73 |
+
animation: float 6s ease-in-out infinite;
|
| 74 |
+
}
|
| 75 |
+
.gradio-container::after {
|
| 76 |
+
content: "∞ √ ∑ π";
|
| 77 |
+
font-size: 4em;
|
| 78 |
+
color: rgba(255, 255, 255, 0.2);
|
| 79 |
+
position: absolute;
|
| 80 |
+
bottom: 10%;
|
| 81 |
+
right: 5%;
|
| 82 |
+
animation: float 8s ease-in-out infinite alternate;
|
| 83 |
+
}
|
| 84 |
+
@keyframes float {
|
| 85 |
+
0% { transform: translateY(0px); }
|
| 86 |
+
50% { transform: translateY(-15px); }
|
| 87 |
+
100% { transform: translateY(0px); }
|
| 88 |
}
|
| 89 |
.title {
|
| 90 |
color: #4DA6FF;
|
|
|
|
| 109 |
"""
|
| 110 |
) as demo:
|
| 111 |
|
| 112 |
+
# Favicon injection
|
| 113 |
+
gr.HTML(
|
| 114 |
+
"""
|
| 115 |
+
<link rel="icon" type="image/png" href="file/favicon.png"/>
|
| 116 |
+
"""
|
| 117 |
+
)
|
| 118 |
+
|
| 119 |
# Header with logo + title
|
| 120 |
gr.HTML(
|
| 121 |
"""
|
| 122 |
<div style='text-align:center;'>
|
| 123 |
+
<img src='file/logo.png' alt='Math Buddy Logo' width='90'
|
| 124 |
+
onerror="this.onerror=null;this.src='favicon.png';"/>
|
| 125 |
</div>
|
| 126 |
"""
|
| 127 |
)
|