orrinin commited on
Commit
cd37197
·
verified ·
1 Parent(s): 912ef80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -7,6 +7,7 @@ import PyPDF2
7
  import faiss
8
  import os
9
  import httpx
 
10
 
11
  mistral_api_key = os.environ.get("API_KEY")
12
 
@@ -36,7 +37,7 @@ def rag_pdf(pdfs: list, question: str) -> str:
36
  text_retrieved = "\n\n".join(retrieved_chunk)
37
  return text_retrieved
38
 
39
- def ask_mistral(message: str, history: list):
40
  messages = []
41
  pdfs = message["files"]
42
  for couple in history:
 
7
  import faiss
8
  import os
9
  import httpx
10
+ import asyncio
11
 
12
  mistral_api_key = os.environ.get("API_KEY")
13
 
 
37
  text_retrieved = "\n\n".join(retrieved_chunk)
38
  return text_retrieved
39
 
40
+ async def ask_mistral(message: str, history: list):
41
  messages = []
42
  pdfs = message["files"]
43
  for couple in history: