Samuel-DD commited on
Commit
f1f38a1
1 Parent(s): ea41ab6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -1,13 +1,11 @@
1
- from fastapi import FastAPI, HTTPException, File, UploadFile
2
  from fastapi.middleware.cors import CORSMiddleware
3
- from typing import Annotated
4
- from pydantic import BaseModel
5
- import uvicorn
6
- from fastapi import FastAPI, UploadFile, File
7
  from typing import Union
8
  import json
9
  import csv
10
  from modeles import bert, squeezebert, deberta
 
11
 
12
 
13
  app = FastAPI()
@@ -33,8 +31,9 @@ async def root():
33
 
34
  @app.post("/uploadfile/")
35
  async def create_upload_file(file: UploadFile, texte: str, model: str):
 
36
 
37
- return {"model": model, "texte": texte, "filename": file.filename}
38
 
39
 
40
  @app.post("/contextText/")
 
1
+ from fastapi import FastAPI, HTTPException, UploadFile
2
  from fastapi.middleware.cors import CORSMiddleware
3
+ from fastapi import FastAPI, UploadFile
 
 
 
4
  from typing import Union
5
  import json
6
  import csv
7
  from modeles import bert, squeezebert, deberta
8
+ from uploadFile import file_to_text
9
 
10
 
11
  app = FastAPI()
 
31
 
32
  @app.post("/uploadfile/")
33
  async def create_upload_file(file: UploadFile, texte: str, model: str):
34
+ fileToText = await file_to_text(file)
35
 
36
+ return {"model": model, "texte": texte, "filename": file.filename, "file_to_text": fileToText}
37
 
38
 
39
  @app.post("/contextText/")