Ali Abid commited on
Commit
2263f48
1 Parent(s): a2a7b95
Files changed (1) hide show
  1. ui/api.py +5 -2
ui/api.py CHANGED
@@ -6,7 +6,10 @@ import subprocess, threading
6
 
7
  FILE_DIR = os.path.dirname(os.path.abspath(__file__))
8
  REPO_DIR = os.path.dirname(FILE_DIR)
 
9
  sys.path.append(REPO_DIR)
 
 
10
  import time
11
 
12
 
@@ -33,8 +36,8 @@ class AutoAPI:
33
  self.openai_key = openai_key
34
  hex = uuid.uuid4().hex
35
  print(hex)
36
- self.state_file = os.path.join(FILE_DIR, "state", f"state_{hex}.json")
37
- self.log_file = os.path.join(FILE_DIR, "state", f"log_{hex}.json")
38
 
39
  newline = "\n"
40
  with open(os.path.join(REPO_DIR, "ai_settings.yaml"), "w") as f:
 
6
 
7
  FILE_DIR = os.path.dirname(os.path.abspath(__file__))
8
  REPO_DIR = os.path.dirname(FILE_DIR)
9
+ STATE_DIR = os.path.join(FILE_DIR, "state")
10
  sys.path.append(REPO_DIR)
11
+ if not os.path.exists(STATE_DIR):
12
+ os.mkdir(STATE_DIR)
13
  import time
14
 
15
 
 
36
  self.openai_key = openai_key
37
  hex = uuid.uuid4().hex
38
  print(hex)
39
+ self.state_file = os.path.join(STATE_DIR, f"state_{hex}.json")
40
+ self.log_file = os.path.join(STATE_DIR, f"log_{hex}.json")
41
 
42
  newline = "\n"
43
  with open(os.path.join(REPO_DIR, "ai_settings.yaml"), "w") as f: