Spaces:
Runtime error
Runtime error
NCTCMumbai
commited on
Commit
•
207595d
1
Parent(s):
f8cf0b4
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from firebase_admin import credentials, firestore
|
|
7 |
import logging
|
8 |
from pathlib import Path
|
9 |
from time import perf_counter
|
10 |
-
|
11 |
import gradio as gr
|
12 |
from jinja2 import Environment, FileSystemLoader
|
13 |
import numpy as np
|
@@ -85,7 +85,9 @@ def update_count_html():
|
|
85 |
return count_html
|
86 |
|
87 |
def store_message(db,query,answer,cross_encoder):
|
88 |
-
|
|
|
|
|
89 |
new_completion.set({
|
90 |
'query': query,
|
91 |
'answer':answer,
|
|
|
7 |
import logging
|
8 |
from pathlib import Path
|
9 |
from time import perf_counter
|
10 |
+
from datetime import datetime
|
11 |
import gradio as gr
|
12 |
from jinja2 import Environment, FileSystemLoader
|
13 |
import numpy as np
|
|
|
85 |
return count_html
|
86 |
|
87 |
def store_message(db,query,answer,cross_encoder):
|
88 |
+
timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
89 |
+
# Create a new document reference with a dynamic document name based on timestamp
|
90 |
+
new_completion_ref = db.collection('Nirvachana').document(f"chatlogs_{timestamp}")
|
91 |
new_completion.set({
|
92 |
'query': query,
|
93 |
'answer':answer,
|