ECUiVADE commited on
Commit
1805827
1 Parent(s): 6040fa8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -61,6 +61,12 @@ class ChatbotAPP:
61
  self.service = self.get_drive_service() # Google Drive service instance
62
  self.app = self.create_app() # Gradio app instance
63
  self.chat_log_name = "" # Filename for the chat log
 
 
 
 
 
 
64
 
65
  # Method to create Google Drive service instance
66
  def get_drive_service(self):
@@ -70,7 +76,7 @@ class ChatbotAPP:
70
  print("Google Service Created")
71
  return self.service
72
 
73
- def generate_unique_id(): #in an instance the user resets using the reset button
74
  # Generate a random sequence of 3 letters and 3 digits
75
  letters = ''.join(random.choices(string.ascii_letters, k=3))
76
  digits = ''.join(random.choices(string.digits, k=3))
@@ -230,7 +236,7 @@ class ChatbotAPP:
230
 
231
  def create_app(self): # Method to launch the Gradio app
232
 
233
- with gr.Blocks() as app:
234
  gr.Markdown("# ECU-IVADE: Conversational AI Model for Aggressive Patient Behavior (Beta Testing)")
235
  unique_id_display = gr.Textbox(value=self.unique_id, label="Session Unique ID", interactive=False,show_copy_button = True)
236
 
@@ -255,7 +261,7 @@ class ChatbotAPP:
255
  """)
256
  agree_status = gr.Checkbox(label="I have read and understand the terms and conditions.")
257
  status_label = gr.Markdown()
258
- start_chat_button = gr.Button("Start Chat with Chatlog")
259
  #submit_info.click(submit_user_info, inputs=[name, occupation, yearsofexp, ethnicity, gender, age], outputs=[status_textbox])
260
  start_chat_button.click(self.start_chat_button_fn, inputs=[agree_status], outputs=[status_label])
261
  #status_textbox = gr.Textbox(interactive = False)
 
61
  self.service = self.get_drive_service() # Google Drive service instance
62
  self.app = self.create_app() # Gradio app instance
63
  self.chat_log_name = "" # Filename for the chat log
64
+ self.css = css = """
65
+ body { background-color: #f0f0f0; }
66
+ button { background-color: #4CAF50; color: white; padding: 14px 20px; margin: 8px 0; border: none; cursor: pointer; }
67
+ button:hover { opacity: 0.8; }
68
+ """
69
+
70
 
71
  # Method to create Google Drive service instance
72
  def get_drive_service(self):
 
76
  print("Google Service Created")
77
  return self.service
78
 
79
+ def generate_unique_id(self): #in an instance the user resets using the reset button
80
  # Generate a random sequence of 3 letters and 3 digits
81
  letters = ''.join(random.choices(string.ascii_letters, k=3))
82
  digits = ''.join(random.choices(string.digits, k=3))
 
236
 
237
  def create_app(self): # Method to launch the Gradio app
238
 
239
+ with gr.Blocks(css=self.css) as app:
240
  gr.Markdown("# ECU-IVADE: Conversational AI Model for Aggressive Patient Behavior (Beta Testing)")
241
  unique_id_display = gr.Textbox(value=self.unique_id, label="Session Unique ID", interactive=False,show_copy_button = True)
242
 
 
261
  """)
262
  agree_status = gr.Checkbox(label="I have read and understand the terms and conditions.")
263
  status_label = gr.Markdown()
264
+ start_chat_button = gr.Button("Agree to Terms and Conditions")
265
  #submit_info.click(submit_user_info, inputs=[name, occupation, yearsofexp, ethnicity, gender, age], outputs=[status_textbox])
266
  start_chat_button.click(self.start_chat_button_fn, inputs=[agree_status], outputs=[status_label])
267
  #status_textbox = gr.Textbox(interactive = False)