Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import torch
|
|
| 4 |
import os
|
| 5 |
import csv
|
| 6 |
from datetime import datetime
|
| 7 |
-
|
| 8 |
# === CONFIGURATION ===
|
| 9 |
MODEL_NAME = "facebook/MobileLLM-Pro" # ✅ Léger et rapide sur CPU
|
| 10 |
INFO_FILE = "infos_medicaux.txt"
|
|
@@ -41,6 +41,7 @@ def log_question(user_message, response):
|
|
| 41 |
writer.writerow([datetime.now().isoformat(), user_message, response])
|
| 42 |
|
| 43 |
# === FONCTION DE CHAT ===
|
|
|
|
| 44 |
def chat_with_finanfa(message, history=None):
|
| 45 |
if history is None:
|
| 46 |
history = []
|
|
|
|
| 4 |
import os
|
| 5 |
import csv
|
| 6 |
from datetime import datetime
|
| 7 |
+
import spaces
|
| 8 |
# === CONFIGURATION ===
|
| 9 |
MODEL_NAME = "facebook/MobileLLM-Pro" # ✅ Léger et rapide sur CPU
|
| 10 |
INFO_FILE = "infos_medicaux.txt"
|
|
|
|
| 41 |
writer.writerow([datetime.now().isoformat(), user_message, response])
|
| 42 |
|
| 43 |
# === FONCTION DE CHAT ===
|
| 44 |
+
@spaces.GPU()
|
| 45 |
def chat_with_finanfa(message, history=None):
|
| 46 |
if history is None:
|
| 47 |
history = []
|