HenryY2023 commited on
Commit
3d797df
·
verified ·
1 Parent(s): 1022bd2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -38,9 +38,13 @@ class ZhipuAILLM(LLM):
38
  return response.choices[0].message.content
39
 
40
  # Database setup
41
- DB_PATH = "/data/chat_history.db"
 
42
 
43
  def init_db():
 
 
 
44
  conn = sqlite3.connect(DB_PATH)
45
  cursor = conn.cursor()
46
  cursor.execute('''
 
38
  return response.choices[0].message.content
39
 
40
  # Database setup
41
+ DB_DIR = "/data"
42
+ DB_PATH = os.path.join(DB_DIR, "chat_history.db")
43
 
44
  def init_db():
45
+ # Create the data directory if it doesn't exist
46
+ os.makedirs(DB_DIR, exist_ok=True)
47
+
48
  conn = sqlite3.connect(DB_PATH)
49
  cursor = conn.cursor()
50
  cursor.execute('''