Spaces:
Sleeping
Sleeping
dinhquangson
commited on
Commit
•
b2ba730
1
Parent(s):
3f5c21e
Update app.py
Browse files
app.py
CHANGED
@@ -82,6 +82,10 @@ def generate_embeddings(dataset, text_field, batch_size=32):
|
|
82 |
|
83 |
@app.post("/uploadfile/")
|
84 |
async def create_upload_file(text_field: str, file: UploadFile = File(...)):
|
|
|
|
|
|
|
|
|
85 |
file_savePath = join(temp_path,file.filename)
|
86 |
|
87 |
with open(file_savePath,'wb') as f:
|
@@ -122,7 +126,13 @@ async def create_upload_file(text_field: str, file: UploadFile = File(...)):
|
|
122 |
payloads=batch,
|
123 |
),
|
124 |
)
|
125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
|
127 |
@app.post("/uploadfile4hypersearch/")
|
128 |
async def upload_file_4_hyper_search(collection_name: str, text_field: str, file: UploadFile = File(...)):
|
|
|
82 |
|
83 |
@app.post("/uploadfile/")
|
84 |
async def create_upload_file(text_field: str, file: UploadFile = File(...)):
|
85 |
+
import time
|
86 |
+
|
87 |
+
start_time = time.time()
|
88 |
+
|
89 |
file_savePath = join(temp_path,file.filename)
|
90 |
|
91 |
with open(file_savePath,'wb') as f:
|
|
|
126 |
payloads=batch,
|
127 |
),
|
128 |
)
|
129 |
+
|
130 |
+
|
131 |
+
end_time = time.time()
|
132 |
+
|
133 |
+
elapsed_time = end_time - start_time
|
134 |
+
|
135 |
+
return {"filename": file.filename, "message": "Done", "execution_time": elapsed_time}
|
136 |
|
137 |
@app.post("/uploadfile4hypersearch/")
|
138 |
async def upload_file_4_hyper_search(collection_name: str, text_field: str, file: UploadFile = File(...)):
|