Update app.py
Browse files
app.py
CHANGED
@@ -102,11 +102,11 @@ def calculate_statistics(embeddings):
|
|
102 |
import shutil
|
103 |
def upload_file(file, model_name, split_strategy, chunk_size, overlap_size, max_tokens, query, top_k):
|
104 |
# Create the full destination file path
|
105 |
-
file_path = os.path.join(FILES_DIR, file.name)
|
106 |
|
107 |
# Write the uploaded file content to the file path
|
108 |
-
with open(file_path, "wb") as f:
|
109 |
-
|
110 |
|
111 |
# Process files and get embeddings
|
112 |
embeddings, chunks = process_files(model_name, split_strategy, chunk_size, overlap_size, max_tokens)
|
|
|
102 |
import shutil
|
103 |
def upload_file(file, model_name, split_strategy, chunk_size, overlap_size, max_tokens, query, top_k):
|
104 |
# Create the full destination file path
|
105 |
+
#file_path = os.path.join(FILES_DIR, file.name)
|
106 |
|
107 |
# Write the uploaded file content to the file path
|
108 |
+
#with open(file_path, "wb") as f:
|
109 |
+
# f.write(file.read()) # Read and write the file content
|
110 |
|
111 |
# Process files and get embeddings
|
112 |
embeddings, chunks = process_files(model_name, split_strategy, chunk_size, overlap_size, max_tokens)
|