Compare commits
4
Commits
37ad6c72b2
...
a74553dc1b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a74553dc1b | ||
|
|
e1c24bd2e6 | ||
|
|
a078e29c92 | ||
|
|
adf0705fe3 |
Regular → Executable
@@ -634,4 +634,5 @@ def upload_file():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", port=5001, debug=True)
|
||||
print(" Acesse: http://localhost:5001")
|
||||
app.run(host="0.0.0.0", port=5001, debug=True, use_reloader=False)
|
||||
Regular → Executable
+2
-2
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"modelo": "nvidia/nemotron-3-ultra-550b-a55b:free",
|
||||
"api_key": "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"
|
||||
"modelo": "gryphe/mythomax-l2-13b",
|
||||
"api_key": ""
|
||||
}
|
||||
Regular → Executable
Regular → Executable
+13
-18
@@ -1,5 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
@@ -8,7 +7,6 @@ echo " Chat com IA - Flask + OpenRouter"
|
||||
echo "============================================"
|
||||
echo ""
|
||||
|
||||
# Detect Python command
|
||||
PYTHON=""
|
||||
for cmd in python3 python; do
|
||||
if command -v "$cmd" &>/dev/null; then
|
||||
@@ -16,28 +14,25 @@ for cmd in python3 python; do
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$PYTHON" ]; then
|
||||
echo "Erro: Python nao encontrado. Instale python3 ou python."
|
||||
echo "Erro: Python nao encontrado."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$DIR/venv" ]; then
|
||||
echo "[1/4] Criando ambiente virtual Python..."
|
||||
$PYTHON -m venv "$DIR/venv"
|
||||
else
|
||||
echo "[1/4] Ambiente virtual ja existe."
|
||||
fi
|
||||
echo "[1/3] Verificando dependencias..."
|
||||
$PYTHON -m pip install -q --upgrade pip --root-user-action=ignore 2>/dev/null || true
|
||||
$PYTHON -m pip install -q -r "$DIR/requirements.txt" --root-user-action=ignore 2>/dev/null || \
|
||||
$PYTHON -m pip install -q -r "$DIR/requirements.txt" --break-system-packages || {
|
||||
echo "Erro ao instalar dependencias. Tente manualmente:"
|
||||
echo " pip install -r requirements.txt"
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "[2/4] Ativando ambiente virtual..."
|
||||
source "$DIR/venv/bin/activate"
|
||||
|
||||
echo "[3/4] Instalando dependencias..."
|
||||
pip install --upgrade pip -q
|
||||
pip install -r "$DIR/requirements.txt" -q
|
||||
|
||||
echo "[4/4] Iniciando aplicacao Flask..."
|
||||
echo "[2/3] Dependencias instaladas."
|
||||
echo "[3/3] Iniciando servidor..."
|
||||
echo ""
|
||||
echo " Acesse: http://localhost:5001"
|
||||
echo " Pressione Ctrl+C para parar."
|
||||
echo " Ctrl+C para parar."
|
||||
echo ""
|
||||
$PYTHON "$DIR/app.py"
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
+7
-8
@@ -960,16 +960,15 @@ async function clearChat() {
|
||||
async function endChat() {
|
||||
appendMessage('user', '/encerrar');
|
||||
try {
|
||||
const res = await fetch('/end', { method: 'POST' });
|
||||
const data = await res.json();
|
||||
chatEl.innerHTML = '';
|
||||
appendMessage('ai', data.reply || 'Chat encerrado. Recarregue a página para começar novamente.');
|
||||
input.value = '';
|
||||
input.disabled = true;
|
||||
sendBtn.disabled = true;
|
||||
await fetch('/end', { method: 'POST' });
|
||||
} catch (err) {
|
||||
appendMessage('system', 'Erro ao encerrar.');
|
||||
// servidor encerrado - esperado
|
||||
}
|
||||
chatEl.innerHTML = '';
|
||||
appendMessage('ai', 'Chat encerrado. Recarregue a página ou inicie o servidor novamente.');
|
||||
input.value = '';
|
||||
input.disabled = true;
|
||||
sendBtn.disabled = true;
|
||||
}
|
||||
|
||||
input.focus();
|
||||
|
||||
Reference in New Issue
Block a user