vikramvasudevan commited on
Commit
fd480f2
·
verified ·
1 Parent(s): af73d7b

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. config.py +11 -6
config.py CHANGED
@@ -2,11 +2,16 @@ import os
2
 
3
 
4
  class SheamiConfig:
5
- _output_dir = "./output"
6
- data_dir = "./data"
7
- logo_path = "./assets/logo.jpg"
8
- logo_small_path = "./assets/logo-small.jpg"
9
- favicon_path="assets/favicon.jpg"
10
 
 
 
 
 
 
 
 
11
  def get_output_dir(thread_id: str):
12
- return os.path.join(SheamiConfig._output_dir, thread_id)
 
 
 
2
 
3
 
4
  class SheamiConfig:
5
+ base_dir = os.path.dirname(os.path.abspath(__file__)) # project root
 
 
 
 
6
 
7
+ _output_dir = os.path.join(base_dir, "output")
8
+ data_dir = os.path.join(base_dir, "data")
9
+ logo_path = os.path.join(base_dir, "assets", "logo.jpg")
10
+ logo_small_path = os.path.join(base_dir, "assets", "logo-small.jpg")
11
+ favicon_path = os.path.join(base_dir, "assets", "favicon.jpg")
12
+
13
+ @staticmethod
14
  def get_output_dir(thread_id: str):
15
+ path = os.path.join(SheamiConfig._output_dir, thread_id)
16
+ os.makedirs(path, exist_ok=True) # ensure it exists
17
+ return path