Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,8 @@ import gradio as gr
|
|
| 3 |
from gradio import Interface, Textbox
|
| 4 |
import sys
|
| 5 |
import os
|
| 6 |
-
import datetime
|
|
|
|
| 7 |
import huggingface_hub
|
| 8 |
from huggingface_hub import Repository, HfApi
|
| 9 |
from datetime import datetime
|
|
@@ -52,8 +53,11 @@ def generate_text() -> str:
|
|
| 52 |
|
| 53 |
def store_message(chatinput: str, chatresponse: str):
|
| 54 |
if chatinput and chatresponse:
|
| 55 |
-
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
| 57 |
user_input = f"User: {chatinput}"
|
| 58 |
chatbot_response = f"Chatbot: {chatresponse}"
|
| 59 |
separator = "-" * 30
|
|
|
|
| 3 |
from gradio import Interface, Textbox
|
| 4 |
import sys
|
| 5 |
import os
|
| 6 |
+
import datetime import datetime, timedelta
|
| 7 |
+
import pytz
|
| 8 |
import huggingface_hub
|
| 9 |
from huggingface_hub import Repository, HfApi
|
| 10 |
from datetime import datetime
|
|
|
|
| 53 |
|
| 54 |
def store_message(chatinput: str, chatresponse: str):
|
| 55 |
if chatinput and chatresponse:
|
| 56 |
+
|
| 57 |
+
now = datetime.now() # current time in UTC
|
| 58 |
+
aus_time = now.astimezone(AUS_TIMEZONE) # convert to Australia timezone
|
| 59 |
+
|
| 60 |
+
timestamp = aus_time.now().strftime("%Y-%m-%d %H:%M:%S")
|
| 61 |
user_input = f"User: {chatinput}"
|
| 62 |
chatbot_response = f"Chatbot: {chatresponse}"
|
| 63 |
separator = "-" * 30
|