treasuremars commited on
Commit
8fccf3e
·
verified ·
1 Parent(s): a63e4bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -38
app.py CHANGED
@@ -7,14 +7,9 @@ df = df[['drug_name', 'medical_condition', 'side_effects']]
7
  df.dropna(inplace=True)
8
 
9
  context_data = []
10
- for i in range(1):
11
- context = ""
12
- for j in range(3):
13
- context += df.columns[j]
14
- context += ": "
15
- context += str(df.iloc[i][j])
16
- context += " "
17
- context_data.append(context)
18
 
19
  import os
20
 
@@ -84,21 +79,14 @@ def rag_memory_stream(text):
84
  # Title and description for the app
85
  title = "AI Medical Assistant for Drug Information and Side Effects"
86
  description = """
87
- <div class="description">
88
- This AI-powered chatbot is designed to provide reliable information about drugs, their side effects, and related medical conditions.
89
- It utilizes the Groq API and LangChain to deliver real-time, accurate responses.
90
-
91
- Ask questions like:
92
- <ul>
93
- <li>What are the side effects of taking aspirin daily?</li>
94
- <li>What is the recommended treatment for a common cold?</li>
95
- <li>What is the disease for constant fatigue and muscle weakness?</li>
96
- <li>What are the symptoms of diabetes?</li>
97
- <li>How can hypertension be managed?</li>
98
- </ul>
99
-
100
- <strong>Disclaimer:</strong> This chatbot is for informational purposes only and is not a substitute for professional medical advice.
101
- </div>
102
  """
103
 
104
  # Customizing Gradio interface for a better look
@@ -108,37 +96,30 @@ custom_css = """
108
  body {
109
  background-color: #f9f9f9;
110
  font-family: Arial, sans-serif;
111
- margin: 0;
112
- padding: 0;
113
  }
114
 
115
  #interface-container {
116
  max-width: 800px;
117
- margin: 50px auto;
118
  padding: 20px;
119
- background: linear-gradient(145deg, #f0f0f0, #000000);
120
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
121
  border-radius: 10px;
122
- border: 1px solid #e0e0e0;
123
  }
124
 
125
- h1 {
126
- text-align: center;
127
  color: #333;
128
  }
129
 
130
- .description {
131
- text-align: justify;
132
- color: #000;
133
- font-size: 1rem;
134
- margin-bottom: 20px;
135
  }
136
 
137
  footer {
138
  text-align: center;
139
  color: #777;
140
- margin-top: 30px;
141
- font-size: 0.9rem;
142
  }
143
  """
144
 
 
7
  df.dropna(inplace=True)
8
 
9
  context_data = []
10
+ for i in range(10):
11
+ context = " | ".join([f"{col}: {df.iloc[i][col]}" for col in df.columns])
12
+ context_data.append(context)
 
 
 
 
 
13
 
14
  import os
15
 
 
79
  # Title and description for the app
80
  title = "AI Medical Assistant for Drug Information and Side Effects"
81
  description = """
82
+ This AI-powered chatbot provides reliable information about drugs, their side effects, and related medical conditions.
83
+ Powered by the Groq API and LangChain, it delivers real-time, accurate responses.
84
+
85
+ Example Questions:
86
+ - What are the side effects of aspirin?
87
+ - What is the disease for constant fatigue and muscle weakness?
88
+
89
+ Disclaimer: This chatbot is for informational purposes only and not a substitute for professional medical advice.
 
 
 
 
 
 
 
90
  """
91
 
92
  # Customizing Gradio interface for a better look
 
96
  body {
97
  background-color: #f9f9f9;
98
  font-family: Arial, sans-serif;
 
 
99
  }
100
 
101
  #interface-container {
102
  max-width: 800px;
103
+ margin: auto;
104
  padding: 20px;
105
+ background: linear-gradient(145deg, #f0f0f0, #ffffff);
106
+ border: 1px solid #ccc;
107
  border-radius: 10px;
108
+ box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
109
  }
110
 
111
+ h1, h2, h3 {
 
112
  color: #333;
113
  }
114
 
115
+ textarea {
116
+ font-size: 16px;
 
 
 
117
  }
118
 
119
  footer {
120
  text-align: center;
121
  color: #777;
122
+ margin-top: 20px;
 
123
  }
124
  """
125