Update ui/ui_core.py
Browse files- ui/ui_core.py +2 -5
ui/ui_core.py
CHANGED
@@ -8,7 +8,6 @@ import gradio as gr
|
|
8 |
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src")))
|
9 |
from txagent.txagent import TxAgent
|
10 |
|
11 |
-
|
12 |
def extract_all_text_from_csv_or_excel(file_path, progress=None, index=0, total=1):
|
13 |
try:
|
14 |
if file_path.endswith(".csv"):
|
@@ -23,7 +22,6 @@ def extract_all_text_from_csv_or_excel(file_path, progress=None, index=0, total=
|
|
23 |
except Exception as e:
|
24 |
return f"Error parsing file: {e}"
|
25 |
|
26 |
-
|
27 |
def extract_all_text_from_pdf(file_path, progress=None, index=0, total=1):
|
28 |
extracted = []
|
29 |
try:
|
@@ -41,10 +39,9 @@ def extract_all_text_from_pdf(file_path, progress=None, index=0, total=1):
|
|
41 |
except Exception as e:
|
42 |
return f"Error parsing PDF: {e}"
|
43 |
|
44 |
-
|
45 |
def create_ui(agent: TxAgent):
|
46 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
47 |
-
gr.Markdown("<h1 style='text-align: center;'
|
48 |
chatbot = gr.Chatbot(label="CPS Assistant", height=600, type="messages")
|
49 |
|
50 |
file_upload = gr.File(
|
@@ -107,4 +104,4 @@ def create_ui(agent: TxAgent):
|
|
107 |
["Is there anything abnormal in the attached blood work report?"]
|
108 |
], inputs=message_input)
|
109 |
|
110 |
-
return demo
|
|
|
8 |
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src")))
|
9 |
from txagent.txagent import TxAgent
|
10 |
|
|
|
11 |
def extract_all_text_from_csv_or_excel(file_path, progress=None, index=0, total=1):
|
12 |
try:
|
13 |
if file_path.endswith(".csv"):
|
|
|
22 |
except Exception as e:
|
23 |
return f"Error parsing file: {e}"
|
24 |
|
|
|
25 |
def extract_all_text_from_pdf(file_path, progress=None, index=0, total=1):
|
26 |
extracted = []
|
27 |
try:
|
|
|
39 |
except Exception as e:
|
40 |
return f"Error parsing PDF: {e}"
|
41 |
|
|
|
42 |
def create_ui(agent: TxAgent):
|
43 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
44 |
+
gr.Markdown("<h1 style='text-align: center;'>\ud83d\udccb CPS: Clinical Patient Support System</h1>")
|
45 |
chatbot = gr.Chatbot(label="CPS Assistant", height=600, type="messages")
|
46 |
|
47 |
file_upload = gr.File(
|
|
|
104 |
["Is there anything abnormal in the attached blood work report?"]
|
105 |
], inputs=message_input)
|
106 |
|
107 |
+
return demo
|