Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,7 @@ import torch
|
|
15 |
import os
|
16 |
import numpy as np
|
17 |
import json
|
|
|
18 |
|
19 |
cache_dir = '/data/KB'
|
20 |
os.makedirs(cache_dir, exist_ok=True)
|
@@ -65,7 +66,7 @@ def add_pdf_gradio(pdf_file_list, progress=gr.Progress()):
|
|
65 |
|
66 |
print(pdf_file_list)
|
67 |
|
68 |
-
pdf_file_list = sorted(pdf_file_list)
|
69 |
knowledge_base_name = str(int(time.time()))
|
70 |
this_cache_dir = os.path.join(cache_dir, knowledge_base_name)
|
71 |
os.makedirs(this_cache_dir, exist_ok=True)
|
|
|
15 |
import os
|
16 |
import numpy as np
|
17 |
import json
|
18 |
+
import time
|
19 |
|
20 |
cache_dir = '/data/KB'
|
21 |
os.makedirs(cache_dir, exist_ok=True)
|
|
|
66 |
|
67 |
print(pdf_file_list)
|
68 |
|
69 |
+
pdf_file_list = sorted(pdf_file_list, key=lambda x: os.path.basename(x))
|
70 |
knowledge_base_name = str(int(time.time()))
|
71 |
this_cache_dir = os.path.join(cache_dir, knowledge_base_name)
|
72 |
os.makedirs(this_cache_dir, exist_ok=True)
|