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