Update run.py
Browse files
run.py
CHANGED
@@ -5,6 +5,7 @@ import json
|
|
5 |
from huggingface_hub import InferenceClient
|
6 |
import gspread
|
7 |
from oauth2client.service_account import ServiceAccountCredentials
|
|
|
8 |
|
9 |
# Google Sheets setup
|
10 |
scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
|
@@ -91,7 +92,9 @@ def response(
|
|
91 |
output += response.token.text
|
92 |
yield output
|
93 |
#output=output+"\n\n<br><details open><summary><strong>Sources</strong></summary><br><ul>"+ "".join(["<li>" + s + "</li>" for s in combination])+"</ul></details>"
|
94 |
-
|
|
|
|
|
95 |
yield output
|
96 |
|
97 |
gr.ChatInterface(response, chatbot=gr.Chatbot(value=[[None,"Herzlich willkommen! Ich bin Chätti ein KI-basiertes Studienassistenzsystem, das für jede Anfrage die am besten Studieninformationen empfiehlt.<br>Erzähle mir, was du gerne tust!"]],render_markdown=True),title="German Studyhelper Chätti").queue().launch(share=True) #False, server_name="0.0.0.0", server_port=7864)
|
|
|
5 |
from huggingface_hub import InferenceClient
|
6 |
import gspread
|
7 |
from oauth2client.service_account import ServiceAccountCredentials
|
8 |
+
from datetime import datetime
|
9 |
|
10 |
# Google Sheets setup
|
11 |
scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
|
|
|
92 |
output += response.token.text
|
93 |
yield output
|
94 |
#output=output+"\n\n<br><details open><summary><strong>Sources</strong></summary><br><ul>"+ "".join(["<li>" + s + "</li>" for s in combination])+"</ul></details>"
|
95 |
+
# Get current date and time
|
96 |
+
now = datetime.now()
|
97 |
+
save_to_sheet(now,prompt, output)
|
98 |
yield output
|
99 |
|
100 |
gr.ChatInterface(response, chatbot=gr.Chatbot(value=[[None,"Herzlich willkommen! Ich bin Chätti ein KI-basiertes Studienassistenzsystem, das für jede Anfrage die am besten Studieninformationen empfiehlt.<br>Erzähle mir, was du gerne tust!"]],render_markdown=True),title="German Studyhelper Chätti").queue().launch(share=True) #False, server_name="0.0.0.0", server_port=7864)
|