Update app.py
Browse files
app.py
CHANGED
@@ -108,7 +108,9 @@ def upload_file(file, model_name, split_strategy, chunk_size, overlap_size, max_
|
|
108 |
# Write the file using file.read() instead of file.value
|
109 |
#with open(os.path.join(FILES_DIR, file.name), "wb") as f:
|
110 |
# f.write(data) # Use .read() to get the file content
|
111 |
-
|
|
|
|
|
112 |
|
113 |
# Process files and get embeddings
|
114 |
embeddings, chunks = process_files(model_name, split_strategy, chunk_size, overlap_size, max_tokens)
|
|
|
108 |
# Write the file using file.read() instead of file.value
|
109 |
#with open(os.path.join(FILES_DIR, file.name), "wb") as f:
|
110 |
# f.write(data) # Use .read() to get the file content
|
111 |
+
file_path = os.path.join(FILES_DIR, file.name)
|
112 |
+
|
113 |
+
shutil.copyfile(file.name, file_path)
|
114 |
|
115 |
# Process files and get embeddings
|
116 |
embeddings, chunks = process_files(model_name, split_strategy, chunk_size, overlap_size, max_tokens)
|