Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -177,28 +177,28 @@ def predict(contexto, frase_mask, chaos_factor):
|
|
| 177 |
token = tokenizer.decode([idx]).strip()
|
| 178 |
res_betina.append(f"**{token}** ({score:.2%})")
|
| 179 |
|
| 180 |
-
# Formatar saída HTML (Estilo
|
| 181 |
html_output = f"""
|
| 182 |
-
<div style="display: flex; gap: 20px; flex-wrap: wrap;
|
| 183 |
-
<div style="flex: 1; min-width: 300px; background-color: #
|
| 184 |
-
<h3 style="color: #
|
| 185 |
-
<p style="font-size: 0.
|
| 186 |
<ol>
|
| 187 |
-
{''.join([f'<li
|
| 188 |
</ol>
|
| 189 |
</div>
|
| 190 |
-
<div style="flex: 1; min-width: 300px; background-color: #
|
| 191 |
-
<h3 style="color: #
|
| 192 |
-
<p style="font-size: 0.
|
| 193 |
-
<ol
|
| 194 |
-
{''.join([f'<li
|
| 195 |
</ol>
|
| 196 |
</div>
|
| 197 |
</div>
|
| 198 |
<br>
|
| 199 |
<details>
|
| 200 |
-
<summary style="cursor: pointer; color: #
|
| 201 |
-
<pre style="font-size: 0.8em; background: #
|
| 202 |
</details>
|
| 203 |
"""
|
| 204 |
return html_output
|
|
@@ -207,16 +207,10 @@ def predict(contexto, frase_mask, chaos_factor):
|
|
| 207 |
# 5. Interface Gradio
|
| 208 |
# ==============================================================================
|
| 209 |
custom_css = """
|
| 210 |
-
|
| 211 |
-
.gradio-container {background-color: #0a0a0a !important; border: 1px solid #333;}
|
| 212 |
-
h1 {color: #00ff9d !important; font-family: 'Courier New', monospace; text-shadow: 0 0 10px #00ff9d;}
|
| 213 |
-
label {color: #00ff9d !important;}
|
| 214 |
-
input, textarea {background-color: #111 !important; color: #fff !important; border: 1px solid #333 !important;}
|
| 215 |
-
button.primary {background: linear-gradient(45deg, #004d00, #00ff9d) !important; border: none !important; color: #000 !important; font-weight: bold !important;}
|
| 216 |
"""
|
| 217 |
|
| 218 |
with gr.Blocks(title="Betina 2.0 - Protocolo Impossível") as demo:
|
| 219 |
-
gr.HTML(f"<style>{custom_css}</style>")
|
| 220 |
gr.Markdown("""
|
| 221 |
# 🌀 BETINA 2.0: PROTOCOLO IMPOSSÍVEL
|
| 222 |
|
|
|
|
| 177 |
token = tokenizer.decode([idx]).strip()
|
| 178 |
res_betina.append(f"**{token}** ({score:.2%})")
|
| 179 |
|
| 180 |
+
# Formatar saída HTML (Estilo Clean)
|
| 181 |
html_output = f"""
|
| 182 |
+
<div style="display: flex; gap: 20px; flex-wrap: wrap;">
|
| 183 |
+
<div style="flex: 1; min-width: 300px; background-color: #f5f5f5; padding: 15px; border-radius: 10px; border: 1px solid #ddd;">
|
| 184 |
+
<h3 style="color: #555; margin-top: 0;">🧠 BERT Padrão</h3>
|
| 185 |
+
<p style="font-size: 0.9em; color: #666;"><i>O que o modelo "decorou" do treino original.</i></p>
|
| 186 |
<ol>
|
| 187 |
+
{''.join([f'<li>{item}</li>' for item in res_base])}
|
| 188 |
</ol>
|
| 189 |
</div>
|
| 190 |
+
<div style="flex: 1; min-width: 300px; background-color: #e6f7ff; padding: 15px; border-radius: 10px; border: 2px solid #1890ff;">
|
| 191 |
+
<h3 style="color: #0050b3; margin-top: 0;">🌀 Betina 2.0</h3>
|
| 192 |
+
<p style="font-size: 0.9em; color: #0050b3;"><i>Correção Dinâmica (Caos: {chaos_factor}x)</i></p>
|
| 193 |
+
<ol>
|
| 194 |
+
{''.join([f'<li>{item}</li>' for item in res_betina])}
|
| 195 |
</ol>
|
| 196 |
</div>
|
| 197 |
</div>
|
| 198 |
<br>
|
| 199 |
<details>
|
| 200 |
+
<summary style="cursor: pointer; color: #888;">📊 Métricas do Vórtice (Estado Interno)</summary>
|
| 201 |
+
<pre style="font-size: 0.8em; background: #333; color: #0f0; padding: 10px; border-radius: 5px; overflow-x: auto;">{str(metrics)}</pre>
|
| 202 |
</details>
|
| 203 |
"""
|
| 204 |
return html_output
|
|
|
|
| 207 |
# 5. Interface Gradio
|
| 208 |
# ==============================================================================
|
| 209 |
custom_css = """
|
| 210 |
+
footer {visibility: hidden}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
"""
|
| 212 |
|
| 213 |
with gr.Blocks(title="Betina 2.0 - Protocolo Impossível") as demo:
|
|
|
|
| 214 |
gr.Markdown("""
|
| 215 |
# 🌀 BETINA 2.0: PROTOCOLO IMPOSSÍVEL
|
| 216 |
|