Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,8 +11,6 @@ import csv
|
|
| 11 |
|
| 12 |
os.environ["OPENAI_API_KEY"] = os.environ['SECRET_CODE']
|
| 13 |
|
| 14 |
-
# Aussie timezone
|
| 15 |
-
AEST = timezone(timedelta(hours=10))
|
| 16 |
|
| 17 |
# Need to write to persistent dataset because cannot store temp data on spaces
|
| 18 |
DATASET_REPO_URL = "https://huggingface.co/datasets/peterpull/MediatorBot"
|
|
@@ -42,7 +40,7 @@ def generate_text() -> str:
|
|
| 42 |
def store_message(chatinput: str, chatresponse: str):
|
| 43 |
if chatinput and chatresponse:
|
| 44 |
with open(DATA_FILE, "a") as file:
|
| 45 |
-
now = datetime.now(
|
| 46 |
timestamp = now.strftime("%Y-%m-%d %H:%M:%S")
|
| 47 |
file.write(f"{timestamp},{chatinput},{chatresponse}\n")
|
| 48 |
print(f"Stored message: {timestamp},{chatinput},{chatresponse}")
|
|
|
|
| 11 |
|
| 12 |
os.environ["OPENAI_API_KEY"] = os.environ['SECRET_CODE']
|
| 13 |
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# Need to write to persistent dataset because cannot store temp data on spaces
|
| 16 |
DATASET_REPO_URL = "https://huggingface.co/datasets/peterpull/MediatorBot"
|
|
|
|
| 40 |
def store_message(chatinput: str, chatresponse: str):
|
| 41 |
if chatinput and chatresponse:
|
| 42 |
with open(DATA_FILE, "a") as file:
|
| 43 |
+
now = datetime.now()
|
| 44 |
timestamp = now.strftime("%Y-%m-%d %H:%M:%S")
|
| 45 |
file.write(f"{timestamp},{chatinput},{chatresponse}\n")
|
| 46 |
print(f"Stored message: {timestamp},{chatinput},{chatresponse}")
|