Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -31,9 +31,12 @@ from datetime import datetime;
|
|
31 |
import socket;
|
32 |
|
33 |
# access data folder of persistent storage
|
34 |
-
from uuid import uuid4
|
35 |
from pathlib import Path
|
36 |
from huggingface_hub import CommitScheduler
|
|
|
|
|
|
|
|
|
37 |
|
38 |
# deprecated
|
39 |
storage_context = StorageContext.from_defaults(persist_dir='./')
|
@@ -52,7 +55,8 @@ class Chatbot:
|
|
52 |
# set chat history data path in data folder (persistent storage)
|
53 |
dataset_dir = Path("logs")
|
54 |
dataset_dir.mkdir(parents=True, exist_ok=True)
|
55 |
-
self.dataset_path = dataset_dir / f"chat_log_{uuid4()}.json"
|
|
|
56 |
|
57 |
|
58 |
self.scheduler = CommitScheduler(
|
|
|
31 |
import socket;
|
32 |
|
33 |
# access data folder of persistent storage
|
|
|
34 |
from pathlib import Path
|
35 |
from huggingface_hub import CommitScheduler
|
36 |
+
from uuid import uuid4
|
37 |
+
|
38 |
+
# generate an unique identifier for the session
|
39 |
+
session_id = uuid4()
|
40 |
|
41 |
# deprecated
|
42 |
storage_context = StorageContext.from_defaults(persist_dir='./')
|
|
|
55 |
# set chat history data path in data folder (persistent storage)
|
56 |
dataset_dir = Path("logs")
|
57 |
dataset_dir.mkdir(parents=True, exist_ok=True)
|
58 |
+
#self.dataset_path = dataset_dir / f"chat_log_{uuid4()}.json"
|
59 |
+
self.dataset_path = dataset_dir / f"chat_log_{session_id}.json"
|
60 |
|
61 |
|
62 |
self.scheduler = CommitScheduler(
|