ruslanmv commited on
Commit
751b536
·
verified ·
1 Parent(s): 3711a42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -18
app.py CHANGED
@@ -63,9 +63,6 @@ iface = gr.Interface(
63
 
64
  iface.launch()
65
  '''
66
-
67
-
68
- # Read CSS from file
69
  css = """
70
  #content_align {
71
  text-align: center;
@@ -74,9 +71,17 @@ css = """
74
  color: #fff;
75
  font-family: Arial, sans-serif;
76
  }
 
 
 
 
 
 
 
 
 
77
  """
78
 
79
- # The welcome message with improved styling
80
  welcome_message = '''
81
  <div id="content_align">
82
  <h1>AI Medical Chatbot</h1>
@@ -85,26 +90,20 @@ welcome_message = '''
85
  </div>
86
  '''
87
 
88
- # Creating Gradio interface with full-screen styling
89
  iface = gr.Interface(
90
  fn=askme,
91
- inputs=["text", "text"],
 
 
 
92
  outputs="text",
 
93
  title="Medical AI Chatbot",
94
  description="Ask me a medical question!",
95
- layout="vertical",
96
  css=css
97
  )
98
 
99
- # Display the welcome message
100
- iface.add_text(welcome_message)
101
-
102
- # Input elements
103
- symptoms_input = iface.add_textbox("text", label="Symptoms", placeholder="Enter symptoms here")
104
- question_input = iface.add_textbox("text", label="Question", placeholder="Enter question here")
105
-
106
- # Output element
107
- answer_output = iface.add_textbox("text", label="Answer")
108
 
109
- # Launch the interface with example usage
110
- iface.launch(examples=examples)
 
63
 
64
  iface.launch()
65
  '''
 
 
 
66
  css = """
67
  #content_align {
68
  text-align: center;
 
71
  color: #fff;
72
  font-family: Arial, sans-serif;
73
  }
74
+
75
+ input[type="text"] {
76
+ padding: 6px;
77
+ width: 100%;
78
+ box-sizing: border-box;
79
+ margin-top: 6px;
80
+ margin-bottom: 16px;
81
+ resize: vertical;
82
+ }
83
  """
84
 
 
85
  welcome_message = '''
86
  <div id="content_align">
87
  <h1>AI Medical Chatbot</h1>
 
90
  </div>
91
  '''
92
 
 
93
  iface = gr.Interface(
94
  fn=askme,
95
+ inputs=[
96
+ gr.inputs.Textbox(lines=2, label="Symptoms", placeholder="Enter symptoms here"),
97
+ gr.inputs.Textbox(lines=2, label="Question", placeholder="Enter question here")
98
+ ],
99
  outputs="text",
100
+ examples=examples,
101
  title="Medical AI Chatbot",
102
  description="Ask me a medical question!",
 
103
  css=css
104
  )
105
 
106
+ iface.set_welcome(welcome_message)
107
+ iface.launch()
 
 
 
 
 
 
 
108
 
109
+