Aspik101 commited on
Commit
6ecab4e
·
1 Parent(s): 002be8f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -15,7 +15,7 @@ params = {
15
 
16
 
17
  def save_log(task, to_save):
18
- with open(log_file_path, "a") as log_file:
19
  current_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
20
  log_file.write(f"[{current_time}] - {task}: {to_save}\n")
21
 
@@ -31,6 +31,7 @@ with gr.Blocks(allow_flagging="auto") as demo:
31
  return "", history + [[user_message, None]]
32
 
33
  def bot(history):
 
34
  stream = llm(prompt = f"Jesteś AI assystentem. Odpowiadaj po polsku. <user>: {history}. <assistant>:", **params)
35
  history[-1][1] = ""
36
  answer_save = ""
 
15
 
16
 
17
  def save_log(task, to_save):
18
+ with open("logs.txt", "a") as log_file:
19
  current_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
20
  log_file.write(f"[{current_time}] - {task}: {to_save}\n")
21
 
 
31
  return "", history + [[user_message, None]]
32
 
33
  def bot(history):
34
+ save_log("question", history)
35
  stream = llm(prompt = f"Jesteś AI assystentem. Odpowiadaj po polsku. <user>: {history}. <assistant>:", **params)
36
  history[-1][1] = ""
37
  answer_save = ""