ECUiVADE commited on
Commit
85969e5
1 Parent(s): d035225

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -176,7 +176,7 @@ def generate(prompt, history):
176
  output = llm(context, max_tokens=400, stop=["Nurse:"], echo=False)
177
  response = output["choices"][0]["text"]
178
  response = response.strip()
179
- yield response
180
 
181
 
182
  # for output in llm(input, stream=True, max_tokens=100, ):
@@ -196,11 +196,11 @@ def generate(prompt, history):
196
  context += response
197
 
198
  print (context)
199
- yield [("User", prompt), ("Barry", response)]
200
 
201
  else:
202
  output = "Did you forget to enter your Details? Please go to the User Info Tab and Input your data. "
203
- yield output
204
 
205
 
206
  def submit_user_info(name,occupation,yearsofexp,ethnicity,gender,age):
@@ -255,10 +255,10 @@ def reset_all():
255
  return f"All Chat components have been rest. Uniqe ID for this session is, {unique_id}. Please note this down.",unique_id
256
 
257
  with gr.Blocks() as app:
258
- gr.Markdown("# ECU-IVADE: Enhanced Conversational UI for Virtual Assistance and Dialogue Engagement")
259
  unique_id_display = gr.Textbox(value=unique_id, label="Session Unique ID", interactive=False,show_copy_button = True)
260
 
261
- with gr.Tab("User Info"):
262
  #name = gr.Textbox(label="Name")
263
  #occupation = gr.Textbox(label="Occupation")
264
  #yearsofexp = gr.Textbox(label="Years of Experience")
@@ -278,10 +278,10 @@ with gr.Blocks() as app:
278
  Please check the box below to acknowledge your agreement and proceed.
279
  """)
280
  agree_status = gr.Checkbox(label="I have read and understand the terms and conditions.")
 
281
  start_chat_button = gr.Button("Start Chat with Chatlog")
282
  print(agree_status)
283
  #submit_info.click(submit_user_info, inputs=[name, occupation, yearsofexp, ethnicity, gender, age], outputs=[status_textbox])
284
- status_label = gr.Markdown()
285
  start_chat_button.click(start_chat_button_fn, inputs=[agree_status], outputs=[status_label])
286
  #status_textbox = gr.Textbox(interactive = False)
287
 
 
176
  output = llm(context, max_tokens=400, stop=["Nurse:"], echo=False)
177
  response = output["choices"][0]["text"]
178
  response = response.strip()
179
+ #yield response
180
 
181
 
182
  # for output in llm(input, stream=True, max_tokens=100, ):
 
196
  context += response
197
 
198
  print (context)
199
+ yield [("User", prompt), ("Barry", response.strip())]
200
 
201
  else:
202
  output = "Did you forget to enter your Details? Please go to the User Info Tab and Input your data. "
203
+ yield [("System", "Please agree to the terms and conditions to start chatting.")]
204
 
205
 
206
  def submit_user_info(name,occupation,yearsofexp,ethnicity,gender,age):
 
255
  return f"All Chat components have been rest. Uniqe ID for this session is, {unique_id}. Please note this down.",unique_id
256
 
257
  with gr.Blocks() as app:
258
+ gr.Markdown("# ECU-IVADE: Conversational AI Model for Aggressive Patient Behavior (Beta Testing)")
259
  unique_id_display = gr.Textbox(value=unique_id, label="Session Unique ID", interactive=False,show_copy_button = True)
260
 
261
+ with gr.Tab("Terms and Conditions"):
262
  #name = gr.Textbox(label="Name")
263
  #occupation = gr.Textbox(label="Occupation")
264
  #yearsofexp = gr.Textbox(label="Years of Experience")
 
278
  Please check the box below to acknowledge your agreement and proceed.
279
  """)
280
  agree_status = gr.Checkbox(label="I have read and understand the terms and conditions.")
281
+ status_label = gr.Markdown()
282
  start_chat_button = gr.Button("Start Chat with Chatlog")
283
  print(agree_status)
284
  #submit_info.click(submit_user_info, inputs=[name, occupation, yearsofexp, ethnicity, gender, age], outputs=[status_textbox])
 
285
  start_chat_button.click(start_chat_button_fn, inputs=[agree_status], outputs=[status_label])
286
  #status_textbox = gr.Textbox(interactive = False)
287