ashishkgpian commited on
Commit
52cf31b
·
verified ·
1 Parent(s): 5aec74c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -9
app.py CHANGED
@@ -20,7 +20,7 @@ def classify_symptoms(text):
20
  except Exception as e:
21
  return f"Error processing classification: {str(e)}"
22
 
23
- # Enhanced CSS for a more professional medical look
24
  custom_css = """
25
  .gradio-container {
26
  max-width: 1200px !important;
@@ -28,7 +28,6 @@ custom_css = """
28
  padding: 2rem !important;
29
  background-color: #f0f4f7 !important;
30
  }
31
-
32
  .main-container {
33
  text-align: center;
34
  padding: 1rem;
@@ -37,19 +36,16 @@ custom_css = """
37
  border-radius: 10px;
38
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
39
  }
40
-
41
  h1 {
42
  color: #2c3e50 !important;
43
  font-size: 2.5rem !important;
44
  margin-bottom: 0.5rem !important;
45
  }
46
-
47
  h3 {
48
  color: #34495e !important;
49
  font-size: 1.2rem !important;
50
  font-weight: normal !important;
51
  }
52
-
53
  .input-container {
54
  background: white !important;
55
  padding: 2rem !important;
@@ -57,22 +53,39 @@ h3 {
57
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
58
  margin-bottom: 1.5rem !important;
59
  }
60
-
61
  textarea {
 
 
62
  border: 2px solid #3498db !important;
63
  border-radius: 8px !important;
64
  padding: 1rem !important;
65
  font-size: 1.1rem !important;
66
  min-height: 120px !important;
67
  }
68
-
 
 
 
 
 
 
 
 
 
 
 
69
  .output-container {
70
  background: white !important;
71
  padding: 2rem !important;
72
  border-radius: 10px !important;
73
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
74
  }
75
-
 
 
 
 
 
76
  .examples-container {
77
  background: white !important;
78
  padding: 1.5rem !important;
@@ -80,7 +93,6 @@ textarea {
80
  margin-top: 1rem !important;
81
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
82
  }
83
-
84
  .footer {
85
  text-align: center;
86
  margin-top: 2rem;
@@ -88,6 +100,7 @@ textarea {
88
  background: white;
89
  border-radius: 10px;
90
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
 
91
  }
92
  """
93
 
@@ -107,6 +120,7 @@ with gr.Blocks(css=custom_css) as demo:
107
  placeholder="Enter detailed patient symptoms and clinical observations...",
108
  lines=5
109
  )
 
110
 
111
  with gr.Row(elem_classes=["output-container"]):
112
  output = gr.JSON(
@@ -125,6 +139,7 @@ with gr.Blocks(css=custom_css) as demo:
125
  label="Example Clinical Cases"
126
  )
127
 
 
128
  input_text.submit(fn=classify_symptoms, inputs=input_text, outputs=output)
129
 
130
  with gr.Row():
 
20
  except Exception as e:
21
  return f"Error processing classification: {str(e)}"
22
 
23
+ # Enhanced CSS with better color contrast and readability
24
  custom_css = """
25
  .gradio-container {
26
  max-width: 1200px !important;
 
28
  padding: 2rem !important;
29
  background-color: #f0f4f7 !important;
30
  }
 
31
  .main-container {
32
  text-align: center;
33
  padding: 1rem;
 
36
  border-radius: 10px;
37
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
38
  }
 
39
  h1 {
40
  color: #2c3e50 !important;
41
  font-size: 2.5rem !important;
42
  margin-bottom: 0.5rem !important;
43
  }
 
44
  h3 {
45
  color: #34495e !important;
46
  font-size: 1.2rem !important;
47
  font-weight: normal !important;
48
  }
 
49
  .input-container {
50
  background: white !important;
51
  padding: 2rem !important;
 
53
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
54
  margin-bottom: 1.5rem !important;
55
  }
 
56
  textarea {
57
+ background: white !important;
58
+ color: #2c3e50 !important;
59
  border: 2px solid #3498db !important;
60
  border-radius: 8px !important;
61
  padding: 1rem !important;
62
  font-size: 1.1rem !important;
63
  min-height: 120px !important;
64
  }
65
+ .submit-btn {
66
+ background-color: #2ecc71 !important;
67
+ color: white !important;
68
+ padding: 0.8rem 2rem !important;
69
+ border-radius: 8px !important;
70
+ font-size: 1.1rem !important;
71
+ margin-top: 1rem !important;
72
+ transition: background-color 0.3s ease !important;
73
+ }
74
+ .submit-btn:hover {
75
+ background-color: #27ae60 !important;
76
+ }
77
  .output-container {
78
  background: white !important;
79
  padding: 2rem !important;
80
  border-radius: 10px !important;
81
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
82
  }
83
+ .output-container pre {
84
+ background: #f8f9fa !important;
85
+ color: #2c3e50 !important;
86
+ border-radius: 8px !important;
87
+ padding: 1rem !important;
88
+ }
89
  .examples-container {
90
  background: white !important;
91
  padding: 1.5rem !important;
 
93
  margin-top: 1rem !important;
94
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
95
  }
 
96
  .footer {
97
  text-align: center;
98
  margin-top: 2rem;
 
100
  background: white;
101
  border-radius: 10px;
102
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
103
+ color: #2c3e50;
104
  }
105
  """
106
 
 
120
  placeholder="Enter detailed patient symptoms and clinical observations...",
121
  lines=5
122
  )
123
+ submit_btn = gr.Button("Analyze Symptoms", elem_classes=["submit-btn"])
124
 
125
  with gr.Row(elem_classes=["output-container"]):
126
  output = gr.JSON(
 
139
  label="Example Clinical Cases"
140
  )
141
 
142
+ submit_btn.click(fn=classify_symptoms, inputs=input_text, outputs=output)
143
  input_text.submit(fn=classify_symptoms, inputs=input_text, outputs=output)
144
 
145
  with gr.Row():