Spaces:
Sleeping
Sleeping
LucasAguetai
commited on
Commit
•
a7d8ebb
1
Parent(s):
f1f38a1
take multiple files
Browse files- app.py +8 -3
- requirements.txt +2 -1
app.py
CHANGED
@@ -6,6 +6,7 @@ import json
|
|
6 |
import csv
|
7 |
from modeles import bert, squeezebert, deberta
|
8 |
from uploadFile import file_to_text
|
|
|
9 |
|
10 |
|
11 |
app = FastAPI()
|
@@ -30,10 +31,14 @@ async def root():
|
|
30 |
|
31 |
|
32 |
@app.post("/uploadfile/")
|
33 |
-
async def create_upload_file(
|
34 |
-
|
|
|
|
|
35 |
|
36 |
-
|
|
|
|
|
37 |
|
38 |
|
39 |
@app.post("/contextText/")
|
|
|
6 |
import csv
|
7 |
from modeles import bert, squeezebert, deberta
|
8 |
from uploadFile import file_to_text
|
9 |
+
from typing import List
|
10 |
|
11 |
|
12 |
app = FastAPI()
|
|
|
31 |
|
32 |
|
33 |
@app.post("/uploadfile/")
|
34 |
+
async def create_upload_file(files: List[UploadFile], texte: str, model: str):
|
35 |
+
res = []
|
36 |
+
for file in files:
|
37 |
+
fileToText = await file_to_text(file)
|
38 |
|
39 |
+
res.append({"model": model, "texte": texte, "filename": file.filename, "file_to_text": fileToText})
|
40 |
+
|
41 |
+
return res
|
42 |
|
43 |
|
44 |
@app.post("/contextText/")
|
requirements.txt
CHANGED
@@ -10,4 +10,5 @@ tf-keras
|
|
10 |
python-docx
|
11 |
PyMuPDF
|
12 |
chardet
|
13 |
-
frontend
|
|
|
|
10 |
python-docx
|
11 |
PyMuPDF
|
12 |
chardet
|
13 |
+
frontend
|
14 |
+
typing
|