LucasAguetai commited on
Commit
11dd172
1 Parent(s): 6166296

modify - bert

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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: str, question: str):
52
  bertAnswer = bert(context, question)
53
- if bert:
54
- return bert
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"):