dinhquangson commited on
Commit
0f36973
1 Parent(s): dede0f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -16,9 +16,9 @@ FILEPATH_PATTERN = "structured_data_doc.parquet"
16
  NUM_PROC = os.cpu_count()
17
  parent_path = dirname(getcwd())
18
 
19
- cache_path = join(parent_path,'.cache')
20
- if not exists(cache_path):
21
- makedirs(cache_path)
22
 
23
  # Determine device based on GPU availability
24
  device = "cuda" if torch.cuda.is_available() else "cpu"
@@ -75,7 +75,7 @@ async def create_upload_file(file: UploadFile = File(...)):
75
  full_dataset = load_dataset("parquet",
76
  data_files=FILEPATH_PATTERN,
77
  split="train",
78
- cache_path=cache_path,
79
  keep_in_memory=True,
80
  num_proc=NUM_PROC*2)
81
  # Generate and append embeddings to the train split
 
16
  NUM_PROC = os.cpu_count()
17
  parent_path = dirname(getcwd())
18
 
19
+ temp_path = join(parent_path,'temp')
20
+ if not exists(temp_path ):
21
+ makedirs(temp_path )
22
 
23
  # Determine device based on GPU availability
24
  device = "cuda" if torch.cuda.is_available() else "cpu"
 
75
  full_dataset = load_dataset("parquet",
76
  data_files=FILEPATH_PATTERN,
77
  split="train",
78
+ cache_path=temp_path,
79
  keep_in_memory=True,
80
  num_proc=NUM_PROC*2)
81
  # Generate and append embeddings to the train split