Spaces:
Runtime error
Runtime error
ImranzamanML
commited on
Commit
•
af7d62e
1
Parent(s):
a490061
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
import streamlit as st
|
2 |
from ai_assistant import ai_doctor_chat
|
3 |
|
|
|
|
|
|
|
4 |
# Create layout with two columns
|
5 |
left_column, right_column = st.columns([1, 3])
|
6 |
|
7 |
# Display image in the left column
|
8 |
-
left_column.image("ai_doctor_img.jpg", width
|
9 |
-
|
10 |
-
# Display title in the right column
|
11 |
-
right_column.markdown("<h1 style='text-align: center;'>Your AI Doctor 🤖</h1>", unsafe_allow_html=True)
|
12 |
|
13 |
# Create a text input box for the OpenAI key
|
14 |
openai_key = right_column.text_input('Enter your OpenAI Key', type='password')
|
@@ -18,7 +18,7 @@ submit = right_column.button('Submit')
|
|
18 |
if submit:
|
19 |
if query and openai_key:
|
20 |
try:
|
21 |
-
with
|
22 |
response = ai_doctor_chat(openai_key, query)
|
23 |
right_column.write(response)
|
24 |
except Exception as e:
|
|
|
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 🤖</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')
|
|
|
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:
|