Spaces:
Sleeping
Sleeping
LucasAguetai
commited on
Commit
·
11dd172
1
Parent(s):
6166296
modify - bert
Browse files
app.py
CHANGED
@@ -48,12 +48,12 @@ async def create_upload_file(texte: str, model: str):
|
|
48 |
return {"model": model, "texte": texte}
|
49 |
|
50 |
@app.post("/bert/")
|
51 |
-
async def qabert(context
|
52 |
bertAnswer = bert(context, question)
|
53 |
-
if
|
54 |
-
return
|
55 |
else:
|
56 |
-
raise HTTPException(status_code=400, detail="Error")
|
57 |
|
58 |
def extract_data(file: UploadFile) -> Union[str, dict, list]:
|
59 |
if file.filename.endswith(".txt"):
|
|
|
48 |
return {"model": model, "texte": texte}
|
49 |
|
50 |
@app.post("/bert/")
|
51 |
+
async def qabert(context, question):
|
52 |
bertAnswer = bert(context, question)
|
53 |
+
if bertAnswer:
|
54 |
+
return bertAnswer
|
55 |
else:
|
56 |
+
raise HTTPException(status_code=400, detail="Error while asking to bert")
|
57 |
|
58 |
def extract_data(file: UploadFile) -> Union[str, dict, list]:
|
59 |
if file.filename.endswith(".txt"):
|