reynaldo22 commited on
Commit
f381251
·
verified ·
1 Parent(s): dc4c97f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -20
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 Cyberpunk)
181
  html_output = f"""
182
- <div style="display: flex; gap: 20px; flex-wrap: wrap; font-family: 'Courier New', monospace;">
183
- <div style="flex: 1; min-width: 300px; background-color: #1a1a1a; padding: 15px; border-radius: 10px; border: 1px solid #444; color: #ccc;">
184
- <h3 style="color: #888; margin-top: 0; border-bottom: 1px solid #444; padding-bottom: 5px;">🧠 BERT (Legado)</h3>
185
- <p style="font-size: 0.8em; color: #666;"><i>Memória Estática</i></p>
186
  <ol>
187
- {''.join([f'<li style="margin-bottom: 5px;">{item}</li>' for item in res_base])}
188
  </ol>
189
  </div>
190
- <div style="flex: 1; min-width: 300px; background-color: #0d0d15; padding: 15px; border-radius: 10px; border: 2px solid #00ff9d; box-shadow: 0 0 15px rgba(0, 255, 157, 0.2);">
191
- <h3 style="color: #00ff9d; margin-top: 0; border-bottom: 1px solid #00ff9d; padding-bottom: 5px;">🌀 VÓRTICE ATIVO</h3>
192
- <p style="font-size: 0.8em; color: #00cc7d;"><i>Correção Dinâmica (Caos: {chaos_factor}x)</i></p>
193
- <ol style="color: #fff;">
194
- {''.join([f'<li style="margin-bottom: 5px; text-shadow: 0 0 5px #00ff9d;">{item}</li>' for item in res_betina])}
195
  </ol>
196
  </div>
197
  </div>
198
  <br>
199
  <details>
200
- <summary style="cursor: pointer; color: #00ff9d; font-family: monospace;">📊 TELEMETRIA DO VÓRTICE</summary>
201
- <pre style="font-size: 0.8em; background: #000; color: #0f0; padding: 10px; border-radius: 5px; overflow-x: auto; border: 1px solid #003300;">{str(metrics)}</pre>
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
- body {background-color: #000000; color: #e0e0e0;}
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