Update app.py
Browse files
app.py
CHANGED
|
@@ -32,7 +32,7 @@ CONFIG = {
|
|
| 32 |
"retry_delay": 5,
|
| 33 |
"timeout": 60,
|
| 34 |
"temperatura": 0.2,
|
| 35 |
-
"max_tokens":
|
| 36 |
}
|
| 37 |
|
| 38 |
rate_limiter = RateLimiter(max_calls=60, period=60)
|
|
@@ -451,7 +451,7 @@ def corrigir_peticao(caso, peticao_texto=None, peticao_arquivo=None, modo_treina
|
|
| 451 |
|
| 452 |
def formatar_correcao(texto):
|
| 453 |
linhas = texto.split('\n')
|
| 454 |
-
texto_formatado = ""
|
| 455 |
for linha in linhas:
|
| 456 |
if "Análise Geral" in linha:
|
| 457 |
texto_formatado += f"### ℹ️ {linha.strip()}\n\n"
|
|
@@ -472,7 +472,7 @@ def formatar_correcao(texto):
|
|
| 472 |
if "Nota Final" in texto_formatado:
|
| 473 |
import re
|
| 474 |
nota_pattern = r"### Nota Final.*?(\d+[.,]\d+|\d+)"
|
| 475 |
-
match = re.search(nota_pattern,
|
| 476 |
if match:
|
| 477 |
nota = match.group(1)
|
| 478 |
texto_formatado = texto_formatado.replace(f"### ⭐ Nota Final\n\n{nota}", f"### ⭐ Nota Final: {nota}/10\n\n")
|
|
|
|
| 32 |
"retry_delay": 5,
|
| 33 |
"timeout": 60,
|
| 34 |
"temperatura": 0.2,
|
| 35 |
+
"max_tokens": 12288 # Aumentado para 8000 para garantir que a resposta completa caiba
|
| 36 |
}
|
| 37 |
|
| 38 |
rate_limiter = RateLimiter(max_calls=60, period=60)
|
|
|
|
| 451 |
|
| 452 |
def formatar_correcao(texto):
|
| 453 |
linhas = texto.split('\n')
|
| 454 |
+
texto_formatado = "" # Corrigido para "texto_formatado" consistentemente
|
| 455 |
for linha in linhas:
|
| 456 |
if "Análise Geral" in linha:
|
| 457 |
texto_formatado += f"### ℹ️ {linha.strip()}\n\n"
|
|
|
|
| 472 |
if "Nota Final" in texto_formatado:
|
| 473 |
import re
|
| 474 |
nota_pattern = r"### Nota Final.*?(\d+[.,]\d+|\d+)"
|
| 475 |
+
match = re.search(nota_pattern, texto_formatado, re.DOTALL)
|
| 476 |
if match:
|
| 477 |
nota = match.group(1)
|
| 478 |
texto_formatado = texto_formatado.replace(f"### ⭐ Nota Final\n\n{nota}", f"### ⭐ Nota Final: {nota}/10\n\n")
|