Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,36 +1,11 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
from ai_assistant import ai_doctor_chat
|
3 |
-
|
4 |
-
# Display title
|
5 |
-
st.markdown("<h1 style='text-align: center;'>Your AI Doctor Using Your Custom Knowledge Base 🤖</h1>", unsafe_allow_html=True)
|
6 |
-
|
7 |
-
# Create layout with two columns
|
8 |
-
left_column, right_column = st.columns([1, 3])
|
9 |
-
|
10 |
-
# Display image in the left column
|
11 |
-
left_column.image("ai_doctor_img.jpg", width=200, use_column_width="auto")
|
12 |
-
|
13 |
-
# Create a text input box for the OpenAI key
|
14 |
-
openai_key = right_column.text_input('Enter your OpenAI Key', type='password')
|
15 |
-
|
16 |
-
query = right_column.text_input('Enter your query', type='default')
|
17 |
-
submit = right_column.button('Submit')
|
18 |
-
if submit:
|
19 |
-
if query and openai_key:
|
20 |
-
try:
|
21 |
-
with st.spinner('Processing your query...'):
|
22 |
-
response = ai_doctor_chat(openai_key, query)
|
23 |
-
right_column.write(response)
|
24 |
-
except Exception as e:
|
25 |
-
right_column.error(f'An error occurred: {e}', icon='🚨')
|
26 |
-
else:
|
27 |
-
right_column.error('Please enter your OpenAI key and Query both!', icon="🚨")
|
28 |
-
|
29 |
-
# Add social media links
|
30 |
st.markdown("---")
|
31 |
st.write("Connect with me on social media:")
|
32 |
-
|
33 |
-
|
34 |
-
st.
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
st.markdown("---")
|
2 |
st.write("Connect with me on social media:")
|
3 |
+
|
4 |
+
# Create layout with four columns for social media links
|
5 |
+
kaggle, linkedin, google_scholar, youtube = st.columns(4)
|
6 |
+
|
7 |
+
# Social media links
|
8 |
+
kaggle.markdown("[Kaggle](https://www.kaggle.com/muhammadimran112233)")
|
9 |
+
linkedin.markdown("[LinkedIn](https://www.linkedin.com/in/muhammad-imran-zaman)")
|
10 |
+
google_scholar.markdown("[Google Scholar](https://scholar.google.com/citations?user=ulVFpy8AAAAJ&hl=en)")
|
11 |
+
youtube.markdown("[YouTube](https://www.youtube.com/@consolioo)")
|