Spaces:
Sleeping
Sleeping
Vela
commited on
Commit
·
159af50
1
Parent(s):
0be18cf
update local host
Browse files- README.md +0 -2
- src/frontend/app/common_fuctions.py +1 -0
- src/frontend/app/homepage.py +2 -22
README.md
CHANGED
@@ -7,8 +7,6 @@ sdk: docker
|
|
7 |
pinned: false
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
11 |
-
|
12 |
<h1><span style="color: crimson;">Yuvabe Care Companion AI</span> - Health Assistant <img src="src\frontend\images\page_icon.jpg" alt="Streamlit logo" width="50" style="border-radius: 25px;"/></h1>
|
13 |
|
14 |
<p align="center">
|
|
|
7 |
pinned: false
|
8 |
---
|
9 |
|
|
|
|
|
10 |
<h1><span style="color: crimson;">Yuvabe Care Companion AI</span> - Health Assistant <img src="src\frontend\images\page_icon.jpg" alt="Streamlit logo" width="50" style="border-radius: 25px;"/></h1>
|
11 |
|
12 |
<p align="center">
|
src/frontend/app/common_fuctions.py
CHANGED
@@ -18,6 +18,7 @@ def img_to_base64(image_path):
|
|
18 |
|
19 |
API_URL = os.getenv("API_URL", "http://127.0.0.1:8000")
|
20 |
|
|
|
21 |
def get_api_response(endpoint:str, prompt: str):
|
22 |
try:
|
23 |
response = requests.post(f"{API_URL}/{endpoint}", json={"prompt": prompt})
|
|
|
18 |
|
19 |
API_URL = os.getenv("API_URL", "http://127.0.0.1:8000")
|
20 |
|
21 |
+
|
22 |
def get_api_response(endpoint:str, prompt: str):
|
23 |
try:
|
24 |
response = requests.post(f"{API_URL}/{endpoint}", json={"prompt": prompt})
|
src/frontend/app/homepage.py
CHANGED
@@ -86,32 +86,12 @@ def config_homepage():
|
|
86 |
|
87 |
logger.info(f"Page successfully configured with title: {PAGE_TITLE}")
|
88 |
st.session_state.config_status = False
|
|
|
89 |
|
90 |
def setup_homepage():
|
91 |
-
st.set_page_config(
|
92 |
-
page_title=PAGE_TITLE,
|
93 |
-
page_icon= PAGE_ICON,
|
94 |
-
layout=PAGE_LAYOUT,
|
95 |
-
initial_sidebar_state="auto",
|
96 |
-
menu_items={"Get help":GITHUB_LINK,
|
97 |
-
"Report a bug": GITHUB_LINK,
|
98 |
-
"About": ABOUT_US}
|
99 |
-
)
|
100 |
-
|
101 |
-
st.markdown(f"""
|
102 |
-
<h1 style="color: darkblue; text-align: left; font-size: 50px;">
|
103 |
-
<i>{PAGE_TITLE} 🏥⚕️🤖</i>
|
104 |
-
</h1>
|
105 |
-
""", unsafe_allow_html=True
|
106 |
-
)
|
107 |
-
|
108 |
-
logger.info(f"Page successfully configured with title: {PAGE_TITLE}")
|
109 |
-
st.session_state.config_status = False
|
110 |
-
|
111 |
-
st.markdown("<hr>", unsafe_allow_html=True) # To add a Horizontal line below title
|
112 |
|
|
|
113 |
img_base64 = common_fuctions.img_to_base64(PAGE_ICON)
|
114 |
-
|
115 |
if img_base64:
|
116 |
st.sidebar.markdown(
|
117 |
f'<img src="data:image/png;base64,{img_base64}" class="cover-glow">',
|
|
|
86 |
|
87 |
logger.info(f"Page successfully configured with title: {PAGE_TITLE}")
|
88 |
st.session_state.config_status = False
|
89 |
+
st.markdown("<hr>", unsafe_allow_html=True) # To add a Horizontal line below title
|
90 |
|
91 |
def setup_homepage():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
+
config_homepage()
|
94 |
img_base64 = common_fuctions.img_to_base64(PAGE_ICON)
|
|
|
95 |
if img_base64:
|
96 |
st.sidebar.markdown(
|
97 |
f'<img src="data:image/png;base64,{img_base64}" class="cover-glow">',
|