Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -45,6 +45,7 @@ st.set_page_config(
|
|
45 |
)
|
46 |
|
47 |
PromptPrefix = 'Create a markdown outline and table with appropriate emojis for body map which define the definition parts, function, conditions of the topic of '
|
|
|
48 |
|
49 |
st.markdown('''### 🧠💪 BodyMapAI
|
50 |
Navigate the Wonders of the Human Anatomy. Explore the intricacies of the human body with Body Map AI. This interactive tool offers a unique journey through various organs and conditions, providing valuable insights and understanding.
|
@@ -217,40 +218,34 @@ def load_score(key):
|
|
217 |
return 0
|
218 |
|
219 |
|
220 |
-
|
221 |
def search_glossary(query):
|
222 |
-
for category, terms in
|
223 |
if query.lower() in (term.lower() for term in terms):
|
224 |
st.markdown(f"#### {category}")
|
225 |
st.write(f"- {query}")
|
226 |
|
227 |
-
query = PromptPrefix + query # Add prompt preface for method step task behavior
|
228 |
-
st.write('## ' + query)
|
229 |
-
|
230 |
all=""
|
|
|
|
|
|
|
231 |
st.write('## 🔍 Running with GPT.') # -------------------------------------------------------------------------------------------------
|
232 |
-
response = chat_with_model(
|
233 |
-
|
234 |
-
|
235 |
-
filename = generate_filename(query + ' --- ' + response, "md")
|
236 |
create_file(filename, query, response, should_save)
|
237 |
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
filename_txt = generate_filename(query + ' --- ' + response2, "
|
243 |
create_file(filename_txt, query, response2, should_save)
|
244 |
-
|
245 |
all = '# Query: ' + query + '# Response: ' + response + '# Response2: ' + response2
|
246 |
-
|
247 |
filename_txt2 = generate_filename(query + ' --- ' + all, "md")
|
248 |
create_file(filename_txt2, query, all, should_save)
|
249 |
-
|
250 |
SpeechSynthesis(all)
|
251 |
return all
|
252 |
|
253 |
-
|
254 |
# Function to display the glossary in a structured format
|
255 |
def display_glossary(glossary, area):
|
256 |
if area in glossary:
|
|
|
45 |
)
|
46 |
|
47 |
PromptPrefix = 'Create a markdown outline and table with appropriate emojis for body map which define the definition parts, function, conditions of the topic of '
|
48 |
+
PromptPrefix2 = 'Create a streamlit python user interface full code listing and app with appropriate emojis for body map which define the definition parts, function, conditions of the topic of '
|
49 |
|
50 |
st.markdown('''### 🧠💪 BodyMapAI
|
51 |
Navigate the Wonders of the Human Anatomy. Explore the intricacies of the human body with Body Map AI. This interactive tool offers a unique journey through various organs and conditions, providing valuable insights and understanding.
|
|
|
218 |
return 0
|
219 |
|
220 |
|
|
|
221 |
def search_glossary(query):
|
222 |
+
for category, terms in roleplaying_glossary.items():
|
223 |
if query.lower() in (term.lower() for term in terms):
|
224 |
st.markdown(f"#### {category}")
|
225 |
st.write(f"- {query}")
|
226 |
|
|
|
|
|
|
|
227 |
all=""
|
228 |
+
|
229 |
+
query2 = PromptPrefix + query # Add prompt preface for method step task behavior
|
230 |
+
# st.write('## ' + query2)
|
231 |
st.write('## 🔍 Running with GPT.') # -------------------------------------------------------------------------------------------------
|
232 |
+
response = chat_with_model(query2)
|
233 |
+
filename = generate_filename(query2 + ' --- ' + response, "md")
|
|
|
|
|
234 |
create_file(filename, query, response, should_save)
|
235 |
|
236 |
+
query3 = PromptPrefix2 + query # Add prompt preface for coding task behavior
|
237 |
+
# st.write('## ' + query3)
|
238 |
+
st.write('## 🔍 Coding with GPT.') # -------------------------------------------------------------------------------------------------
|
239 |
+
response2 = chat_with_model(query3)
|
240 |
+
filename_txt = generate_filename(query + ' --- ' + response2, "py")
|
241 |
create_file(filename_txt, query, response2, should_save)
|
242 |
+
|
243 |
all = '# Query: ' + query + '# Response: ' + response + '# Response2: ' + response2
|
|
|
244 |
filename_txt2 = generate_filename(query + ' --- ' + all, "md")
|
245 |
create_file(filename_txt2, query, all, should_save)
|
|
|
246 |
SpeechSynthesis(all)
|
247 |
return all
|
248 |
|
|
|
249 |
# Function to display the glossary in a structured format
|
250 |
def display_glossary(glossary, area):
|
251 |
if area in glossary:
|