Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 3 |
import torch
|
| 4 |
import os
|
| 5 |
-
|
| 6 |
# === CONFIGURATION ===
|
| 7 |
MODEL_NAME = "facebook/MobileLLM-Pro" # ✅ Plus léger et rapide sur CPU
|
| 8 |
INFO_FILE = "infos_medicaux.txt"
|
|
@@ -27,7 +27,7 @@ else:
|
|
| 27 |
medical_context = ""
|
| 28 |
print("⚠️ Aucun fichier infos_medicaux.txt trouvé.")
|
| 29 |
|
| 30 |
-
|
| 31 |
def chat_with_finanfa(message, history=None):
|
| 32 |
if history is None:
|
| 33 |
history = []
|
|
|
|
| 2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 3 |
import torch
|
| 4 |
import os
|
| 5 |
+
import spaces
|
| 6 |
# === CONFIGURATION ===
|
| 7 |
MODEL_NAME = "facebook/MobileLLM-Pro" # ✅ Plus léger et rapide sur CPU
|
| 8 |
INFO_FILE = "infos_medicaux.txt"
|
|
|
|
| 27 |
medical_context = ""
|
| 28 |
print("⚠️ Aucun fichier infos_medicaux.txt trouvé.")
|
| 29 |
|
| 30 |
+
@spaces.GPU()
|
| 31 |
def chat_with_finanfa(message, history=None):
|
| 32 |
if history is None:
|
| 33 |
history = []
|