mathslearn commited on
Commit
ecb3efd
·
verified ·
1 Parent(s): 0f5132d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -12,15 +12,23 @@ from PIL import Image
12
  st.title("Nexus TCM Chatbot")
13
  query = st.text_input("Query: ", key="input")
14
 
15
- # Load the logo image
16
- logo_path = "https://huggingface.co/spaces/mathslearn/chatbot_test_streamlit/blob/main/logo.jpeg"
17
- logo_image = Image.open(logo_path)
 
 
 
 
 
 
 
 
18
 
19
  # Desired height for the logo
20
- logo_height = 100
21
 
22
  # Display the logo with specified height
23
- st.image(logo_image, caption="Nexus TCM Chatbot Logo", use_column_width=True, height=logo_height)
24
 
25
  if 'responses' not in st.session_state:
26
  st.session_state['responses'] = []
 
12
  st.title("Nexus TCM Chatbot")
13
  query = st.text_input("Query: ", key="input")
14
 
15
+ from PIL import Image
16
+ from transformers.hub import get_dir_url
17
+
18
+ # Specify the relative path to the logo within the Hugging Face space
19
+ logo_path = "spaces/mathslearn/chatbot_test_streamlit/logo.jpeg"
20
+
21
+ # Get the URL to the directory containing the logo
22
+ logo_dir_url = get_dir_url(logo_path)
23
+
24
+ # Concatenate the directory URL and logo path to get the full URL
25
+ logo_url = f"{logo_dir_url}/{logo_path}"
26
 
27
  # Desired height for the logo
28
+ logo_height = 200
29
 
30
  # Display the logo with specified height
31
+ st.image(logo_url, caption="Nexus TCM Chatbot Logo", use_column_width=True, height=logo_height)
32
 
33
  if 'responses' not in st.session_state:
34
  st.session_state['responses'] = []