Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -143,8 +143,6 @@ def link_button_with_emoji(url, title, emoji_summary):
|
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
-
|
| 147 |
-
|
| 148 |
# Homunculus parts and their corresponding emojis
|
| 149 |
homunculus_parts = {
|
| 150 |
"Head": "🧠", "Left Eye": "👁️", "Right Eye": "👁️",
|
|
@@ -163,14 +161,12 @@ homunculus_parts = {
|
|
| 163 |
"Left Shin": "🦵", "Right Shin": "🦵"
|
| 164 |
}
|
| 165 |
|
| 166 |
-
|
| 167 |
# Function to display the homunculus parts with expanders and chat buttons
|
| 168 |
def display_homunculus_parts():
|
| 169 |
st.title("Homunculus Model")
|
| 170 |
|
| 171 |
-
#
|
| 172 |
-
with st.expander("Head (
|
| 173 |
-
st.write("Contains: Left Eye 👁️, Right Eye 👁️, Left Eyebrow 🤨, Right Eyebrow 🤨, Nose 👃, Mouth 👄")
|
| 174 |
head_parts = ["Left Eye", "Right Eye", "Left Eyebrow", "Right Eyebrow", "Nose", "Mouth"]
|
| 175 |
for part in head_parts:
|
| 176 |
prompt = f"Learn about the key features of {part}"
|
|
@@ -178,29 +174,27 @@ def display_homunculus_parts():
|
|
| 178 |
response = chat_with_model(prompt, part)
|
| 179 |
st.write(response)
|
| 180 |
|
| 181 |
-
#
|
| 182 |
-
|
|
|
|
| 183 |
col1, col2 = st.columns(2)
|
| 184 |
with col1:
|
| 185 |
-
with st.expander(f"Left {part} (
|
| 186 |
-
st.write(f"Details about the Left {part}")
|
| 187 |
prompt = f"Learn about the key features of Left {part}"
|
| 188 |
if st.button(f"Explore Left {part}", key=f"Left {part}"):
|
| 189 |
response = chat_with_model(prompt, f"Left {part}")
|
| 190 |
st.write(response)
|
| 191 |
with col2:
|
| 192 |
-
with st.expander(f"Right {part} (
|
| 193 |
-
st.write(f"Details about the Right {part}")
|
| 194 |
prompt = f"Learn about the key features of Right {part}"
|
| 195 |
if st.button(f"Explore Right {part}", key=f"Right {part}"):
|
| 196 |
response = chat_with_model(prompt, f"Right {part}")
|
| 197 |
st.write(response)
|
| 198 |
|
| 199 |
-
#
|
| 200 |
central_parts = ["Neck", "Chest", "Abdomen", "Pelvis"]
|
| 201 |
for part in central_parts:
|
| 202 |
-
with st.expander(f"{part} ({
|
| 203 |
-
st.write(f"Details about the {part}")
|
| 204 |
prompt = f"Learn about the key features of {part}"
|
| 205 |
if st.button(f"Explore {part}", key=part):
|
| 206 |
response = chat_with_model(prompt, part)
|
|
|
|
| 143 |
|
| 144 |
|
| 145 |
|
|
|
|
|
|
|
| 146 |
# Homunculus parts and their corresponding emojis
|
| 147 |
homunculus_parts = {
|
| 148 |
"Head": "🧠", "Left Eye": "👁️", "Right Eye": "👁️",
|
|
|
|
| 161 |
"Left Shin": "🦵", "Right Shin": "🦵"
|
| 162 |
}
|
| 163 |
|
|
|
|
| 164 |
# Function to display the homunculus parts with expanders and chat buttons
|
| 165 |
def display_homunculus_parts():
|
| 166 |
st.title("Homunculus Model")
|
| 167 |
|
| 168 |
+
# Displaying container part: Head
|
| 169 |
+
with st.expander(f"Head ({homunculus_parts['Head']})", expanded=False):
|
|
|
|
| 170 |
head_parts = ["Left Eye", "Right Eye", "Left Eyebrow", "Right Eyebrow", "Nose", "Mouth"]
|
| 171 |
for part in head_parts:
|
| 172 |
prompt = f"Learn about the key features of {part}"
|
|
|
|
| 174 |
response = chat_with_model(prompt, part)
|
| 175 |
st.write(response)
|
| 176 |
|
| 177 |
+
# Displaying symmetric body parts
|
| 178 |
+
symmetric_parts = ["Shoulder", "Upper Arm", "Elbow", "Forearm", "Wrist", "Hand", "Hip", "Thigh", "Knee", "Shin"]
|
| 179 |
+
for part in symmetric_parts:
|
| 180 |
col1, col2 = st.columns(2)
|
| 181 |
with col1:
|
| 182 |
+
with st.expander(f"Left {part} ({homunculus_parts[f'Left {part}']})", expanded=False):
|
|
|
|
| 183 |
prompt = f"Learn about the key features of Left {part}"
|
| 184 |
if st.button(f"Explore Left {part}", key=f"Left {part}"):
|
| 185 |
response = chat_with_model(prompt, f"Left {part}")
|
| 186 |
st.write(response)
|
| 187 |
with col2:
|
| 188 |
+
with st.expander(f"Right {part} ({homunculus_parts[f'Right {part}']})", expanded=False):
|
|
|
|
| 189 |
prompt = f"Learn about the key features of Right {part}"
|
| 190 |
if st.button(f"Explore Right {part}", key=f"Right {part}"):
|
| 191 |
response = chat_with_model(prompt, f"Right {part}")
|
| 192 |
st.write(response)
|
| 193 |
|
| 194 |
+
# Displaying central body parts
|
| 195 |
central_parts = ["Neck", "Chest", "Abdomen", "Pelvis"]
|
| 196 |
for part in central_parts:
|
| 197 |
+
with st.expander(f"{part} ({homunculus_parts[part]})", expanded=False):
|
|
|
|
| 198 |
prompt = f"Learn about the key features of {part}"
|
| 199 |
if st.button(f"Explore {part}", key=part):
|
| 200 |
response = chat_with_model(prompt, part)
|