Dave67350 commited on
Commit
d3ea3d6
·
verified ·
1 Parent(s): 85cf467

Update Gradio_UI.py

Browse files
Files changed (1) hide show
  1. Gradio_UI.py +10 -14
Gradio_UI.py CHANGED
@@ -1,5 +1,7 @@
1
  c#!/usr/bin/env python
2
  # coding=utf-8
 
 
3
  import mimetypes
4
  import os
5
  import re
@@ -98,8 +100,7 @@ def step_by_step_agent(user_input, state):
98
  Generated by AI Act Assistant.
99
  """
100
 
101
- import csv
102
- import datetime
103
 
104
  try:
105
  detected_lang = detect(filled_template)
@@ -127,14 +128,12 @@ import datetime
127
  def launch_step_by_step_ui():
128
  with gr.Blocks(fill_height=True) as demo:
129
  initial_question = QUESTIONS[0][1]
130
- initial_message = gr.ChatMessage(role="assistant", content=(
131
- f"👋 Welcome! I will guide you through the AI Act compliance form.
132
- "
133
- f"Let's begin with a few questions to generate your compliance register.
134
-
135
- "
136
- f"{initial_question}"
137
- ))
138
  stored_messages = gr.State([initial_message])
139
  chatbot = gr.Chatbot(type="messages", value=stored_messages)
140
  msg = gr.Textbox(label="Your answer")
@@ -149,10 +148,7 @@ def launch_step_by_step_ui():
149
  if isinstance(reply, str):
150
  messages.append(gr.ChatMessage(role="assistant", content=reply))
151
 
152
- if not file_path:
153
- file_path = None
154
- if file_path is None:
155
- file_path = ""
156
  return messages, updated_state, file_path
157
 
158
  def restart_conversation():
 
1
  c#!/usr/bin/env python
2
  # coding=utf-8
3
+ import csv
4
+ import datetime
5
  import mimetypes
6
  import os
7
  import re
 
100
  Generated by AI Act Assistant.
101
  """
102
 
103
+
 
104
 
105
  try:
106
  detected_lang = detect(filled_template)
 
128
  def launch_step_by_step_ui():
129
  with gr.Blocks(fill_height=True) as demo:
130
  initial_question = QUESTIONS[0][1]
131
+ initial_message = gr.ChatMessage(role="assistant", content="""
132
+ 👋 Welcome! I will guide you through the AI Act compliance form.
133
+ Let's begin with a few questions to generate your compliance register.
134
+
135
+ What is the name of your organization?
136
+ """)
 
 
137
  stored_messages = gr.State([initial_message])
138
  chatbot = gr.Chatbot(type="messages", value=stored_messages)
139
  msg = gr.Textbox(label="Your answer")
 
148
  if isinstance(reply, str):
149
  messages.append(gr.ChatMessage(role="assistant", content=reply))
150
 
151
+ file_path = file_path or ""
 
 
 
152
  return messages, updated_state, file_path
153
 
154
  def restart_conversation():