benyelles0mehdi0dris commited on
Commit
955b9ed
·
1 Parent(s): 7f32a57

bdlt model

Browse files
Files changed (1) hide show
  1. backend_fastapi.py +6 -1
backend_fastapi.py CHANGED
@@ -38,11 +38,16 @@ async def serve_frontend(request: Request):
38
  HF_API_KEY = os.getenv("HF_API_KEY", "")
39
  HEADERS = {"Authorization": f"Bearer {HF_API_KEY}"} if HF_API_KEY else {}
40
 
 
 
41
  HF_MODELS = {
42
  "summary": "facebook/bart-large-cnn",
43
- "qa": "deepset/roberta-base-squad2"
 
44
  }
45
 
 
 
46
  HF_API_URL = "https://api-inference.huggingface.co/models/"
47
 
48
  def query_huggingface(model: str, payload: dict):
 
38
  HF_API_KEY = os.getenv("HF_API_KEY", "")
39
  HEADERS = {"Authorization": f"Bearer {HF_API_KEY}"} if HF_API_KEY else {}
40
 
41
+ # Configuration Hugging Face
42
+
43
  HF_MODELS = {
44
  "summary": "facebook/bart-large-cnn",
45
+ # "qa": "deepset/roberta-base-squad2" # <- ancien modèle commenté
46
+ "qa": "HPAI-BSC/Llama3-Aloe-8B-Alpha" # <- nouveau modèle
47
  }
48
 
49
+
50
+
51
  HF_API_URL = "https://api-inference.huggingface.co/models/"
52
 
53
  def query_huggingface(model: str, payload: dict):