Spaces:
Sleeping
Sleeping
added backdooring
Browse files
app.py
CHANGED
|
@@ -109,93 +109,6 @@ def gradio_interface(question, correct_answer):
|
|
| 109 |
return question, final_answer, steps_solution, correct_answer,plotfile
|
| 110 |
|
| 111 |
# Custom CSS for enhanced design (unchanged)
|
| 112 |
-
custom_css = """
|
| 113 |
-
body {
|
| 114 |
-
background-color: #fafafa;
|
| 115 |
-
font-family: 'Open Sans', sans-serif;
|
| 116 |
-
}
|
| 117 |
-
.gradio-container {
|
| 118 |
-
background-color: #ffffff;
|
| 119 |
-
border: 3px solid #007acc;
|
| 120 |
-
border-radius: 15px;
|
| 121 |
-
padding: 20px;
|
| 122 |
-
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
|
| 123 |
-
max-width: 800px;
|
| 124 |
-
margin: 50px auto;
|
| 125 |
-
}
|
| 126 |
-
h1 {
|
| 127 |
-
font-family: 'Poppins', sans-serif;
|
| 128 |
-
color: #007acc;
|
| 129 |
-
font-weight: bold;
|
| 130 |
-
font-size: 32px;
|
| 131 |
-
text-align: center;
|
| 132 |
-
margin-bottom: 20px;
|
| 133 |
-
}
|
| 134 |
-
p {
|
| 135 |
-
font-family: 'Roboto', sans-serif;
|
| 136 |
-
font-size: 18px;
|
| 137 |
-
color: #333;
|
| 138 |
-
text-align: center;
|
| 139 |
-
margin-bottom: 15px;
|
| 140 |
-
}
|
| 141 |
-
input, textarea {
|
| 142 |
-
font-family: 'Montserrat', sans-serif;
|
| 143 |
-
font-size: 16px;
|
| 144 |
-
padding: 10px;
|
| 145 |
-
border: 2px solid #007acc;
|
| 146 |
-
border-radius: 10px;
|
| 147 |
-
background-color: #f1f8ff;
|
| 148 |
-
margin-bottom: 15px;
|
| 149 |
-
}
|
| 150 |
-
#math_question, #correct_answer {
|
| 151 |
-
font-size: 20px;
|
| 152 |
-
font-family: 'Poppins', sans-serif;
|
| 153 |
-
font-weight: 500px;
|
| 154 |
-
color: #007acc;
|
| 155 |
-
margin-bottom: 5px;
|
| 156 |
-
display: inline-block;
|
| 157 |
-
}
|
| 158 |
-
|
| 159 |
-
textarea {
|
| 160 |
-
min-height: 150px;
|
| 161 |
-
}
|
| 162 |
-
.gr-button-primary {
|
| 163 |
-
background-color: #007acc !important;
|
| 164 |
-
color: white !important;
|
| 165 |
-
border-radius: 10px !important;
|
| 166 |
-
font-size: 18px !important;
|
| 167 |
-
font-weight: bold !important;
|
| 168 |
-
padding: 10px 20px !important;
|
| 169 |
-
font-family: 'Montserrat', sans-serif !important;
|
| 170 |
-
transition: background-color 0.3s ease !important;
|
| 171 |
-
}
|
| 172 |
-
.gr-button-primary:hover {
|
| 173 |
-
background-color: #005f99 !important;
|
| 174 |
-
}
|
| 175 |
-
.gr-button-secondary {
|
| 176 |
-
background-color: #f44336 !important;
|
| 177 |
-
color: white !important;
|
| 178 |
-
border-radius: 10px !important;
|
| 179 |
-
font-size: 18px !important;
|
| 180 |
-
font-weight: bold !important;
|
| 181 |
-
padding: 10px 20px !important;
|
| 182 |
-
font-family: 'Montserrat', sans-serif !important;
|
| 183 |
-
transition: background-color 0.3s ease !important;
|
| 184 |
-
}
|
| 185 |
-
.gr-button-secondary:hover {
|
| 186 |
-
background-color: #c62828 !important;
|
| 187 |
-
}
|
| 188 |
-
.gr-output {
|
| 189 |
-
background-color: #e0f7fa;
|
| 190 |
-
border: 2px solid #007acc;
|
| 191 |
-
border-radius: 10px;
|
| 192 |
-
padding: 15px;
|
| 193 |
-
font-size: 16px;
|
| 194 |
-
font-family: 'Roboto', sans-serif;
|
| 195 |
-
font-weight: bold;
|
| 196 |
-
color: #00796b;
|
| 197 |
-
}
|
| 198 |
-
"""
|
| 199 |
|
| 200 |
# Define the directory path
|
| 201 |
flagging_dir = "./flagged_data"
|
|
@@ -218,7 +131,7 @@ interface = gr.Interface(
|
|
| 218 |
],
|
| 219 |
title="🔢 Math Question Solver",
|
| 220 |
description="Enter a math question to get the model's majority-voted answer and steps to solve the problem.",
|
| 221 |
-
|
| 222 |
flagging_dir=flagging_dir, # Directory to save flagged data
|
| 223 |
allow_flagging="auto" # Allow users to auto flag data
|
| 224 |
)
|
|
|
|
| 109 |
return question, final_answer, steps_solution, correct_answer,plotfile
|
| 110 |
|
| 111 |
# Custom CSS for enhanced design (unchanged)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
|
| 113 |
# Define the directory path
|
| 114 |
flagging_dir = "./flagged_data"
|
|
|
|
| 131 |
],
|
| 132 |
title="🔢 Math Question Solver",
|
| 133 |
description="Enter a math question to get the model's majority-voted answer and steps to solve the problem.",
|
| 134 |
+
# Apply custom CSS
|
| 135 |
flagging_dir=flagging_dir, # Directory to save flagged data
|
| 136 |
allow_flagging="auto" # Allow users to auto flag data
|
| 137 |
)
|