vpcom commited on
Commit
4eb801e
·
1 Parent(s): 953e4ee

test: let's see if we can have access to chatbot input and history

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -151,6 +151,9 @@ chatbot = gr.Chatbot(label="PersianGPT",
151
  show_share_button=True,
152
  show_copy_button=True,
153
  bubble_full_width = False)
 
 
 
154
  textbox = gr.Textbox(
155
  label="textbox",
156
  container=False,
@@ -188,16 +191,14 @@ def vote(data: gr.LikeData):
188
  else:
189
  print("You downvoted this response: " + data.value)
190
 
191
- print(data)
192
-
193
  with open(DATA_FILE, "a") as jsonlfile:
194
  json_data = [
195
  json.dumps(
196
  {
197
  "index": data.index,
198
  "time_stamp": time.time(),
199
- "prompt": "",
200
- "history": "",
201
  "system prompt": additional_inputs[0].value,
202
  "temperature": additional_inputs[1].value,
203
  "max_new_tokens": additional_inputs[2].value,
 
151
  show_share_button=True,
152
  show_copy_button=True,
153
  bubble_full_width = False)
154
+
155
+ print(dir(chatbot))
156
+
157
  textbox = gr.Textbox(
158
  label="textbox",
159
  container=False,
 
191
  else:
192
  print("You downvoted this response: " + data.value)
193
 
 
 
194
  with open(DATA_FILE, "a") as jsonlfile:
195
  json_data = [
196
  json.dumps(
197
  {
198
  "index": data.index,
199
  "time_stamp": time.time(),
200
+ "prompt": chatbot.input,
201
+ "history": chatbot.history,
202
  "system prompt": additional_inputs[0].value,
203
  "temperature": additional_inputs[1].value,
204
  "max_new_tokens": additional_inputs[2].value,