awacke1 commited on
Commit
03b58ae
·
verified ·
1 Parent(s): 61a4eff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -20
app.py CHANGED
@@ -18,6 +18,7 @@ st.set_page_config(
18
  )
19
 
20
  PromptPrefix = 'Create a markdown outline and table with appropriate emojis for science fiction stories, plotlines, and background on aliens, robots and spaceships for the topics of '
 
21
 
22
  st.markdown('''### SciFiAI 🚀👽🌌
23
  - **Explore New Worlds with Mixable Science Fiction AI:** Journey through the cosmos with an AI that writes the future.
@@ -102,37 +103,31 @@ transhuman_glossary = {
102
  "👽 Terrorists": ["Synthetic Virus Creators🧬🦠", "EMP Terrorists🌩️💣", "Dark Web Cults💻🕯️", "Nanotech Extremists🔬🧨", "Anti-Humanity Sects🚫🚶‍♂️", "Quantum Data Destroyers💻🧨", "Terraforming Saboteurs🌍🔧", "Mind Control Radicals🧠📡", "Space Station Seizers🛰️🚨", "Transdimensional Threats🌀👽"],
103
  }
104
 
105
- # Updated function to search glossary and display results with enhanced content
106
  def search_glossary(query):
107
- for category, terms in transhuman_glossary.items():
108
  if query.lower() in (term.lower() for term in terms):
109
  st.markdown(f"#### {category}")
110
  st.write(f"- {query}")
111
 
112
- query = PromptPrefix + query # Add prompt preface for method step task behavior
113
- st.write('## ' + query)
114
-
115
  all=""
 
 
 
116
  st.write('## 🔍 Running with GPT.') # -------------------------------------------------------------------------------------------------
117
- response = chat_with_model(query)
118
- #st.write(response)
119
-
120
- filename = generate_filename(query + ' --- ' + response, "md")
121
  create_file(filename, query, response, should_save)
122
 
123
- #st.write('## 🔍 Running with Llama.') # -------------------------------------------------------------------------------------------------
124
- #response2 = StreamLLMChatResponse(query)
125
- #st.write(response2)
126
-
127
- #filename_txt = generate_filename(query + ' --- ' + response2, "md")
128
- #create_file(filename_txt, query, response2, should_save)
129
-
130
- #all = '# Query: ' + query + '# Response: ' + response + '# Response2: ' + response2
131
- all = '# Query: ' + query + '# Response: ' + response
132
-
133
  filename_txt2 = generate_filename(query + ' --- ' + all, "md")
134
  create_file(filename_txt2, query, all, should_save)
135
-
136
  SpeechSynthesis(all)
137
  return all
138
 
 
18
  )
19
 
20
  PromptPrefix = 'Create a markdown outline and table with appropriate emojis for science fiction stories, plotlines, and background on aliens, robots and spaceships for the topics of '
21
+ PromptPrefix2 = 'Create a streamlit python user interface and app with appropriate emojis for science fiction stories, plotlines, and background on aliens, robots and spaceships showing full source code listing for the topics of: '
22
 
23
  st.markdown('''### SciFiAI 🚀👽🌌
24
  - **Explore New Worlds with Mixable Science Fiction AI:** Journey through the cosmos with an AI that writes the future.
 
103
  "👽 Terrorists": ["Synthetic Virus Creators🧬🦠", "EMP Terrorists🌩️💣", "Dark Web Cults💻🕯️", "Nanotech Extremists🔬🧨", "Anti-Humanity Sects🚫🚶‍♂️", "Quantum Data Destroyers💻🧨", "Terraforming Saboteurs🌍🔧", "Mind Control Radicals🧠📡", "Space Station Seizers🛰️🚨", "Transdimensional Threats🌀👽"],
104
  }
105
 
 
106
  def search_glossary(query):
107
+ for category, terms in roleplaying_glossary.items():
108
  if query.lower() in (term.lower() for term in terms):
109
  st.markdown(f"#### {category}")
110
  st.write(f"- {query}")
111
 
 
 
 
112
  all=""
113
+
114
+ query2 = PromptPrefix + query # Add prompt preface for method step task behavior
115
+ # st.write('## ' + query2)
116
  st.write('## 🔍 Running with GPT.') # -------------------------------------------------------------------------------------------------
117
+ response = chat_with_model(query2)
118
+ filename = generate_filename(query2 + ' --- ' + response, "md")
 
 
119
  create_file(filename, query, response, should_save)
120
 
121
+ query3 = PromptPrefix2 + query # Add prompt preface for coding task behavior
122
+ # st.write('## ' + query3)
123
+ st.write('## 🔍 Coding with GPT.') # -------------------------------------------------------------------------------------------------
124
+ response2 = chat_with_model(query3)
125
+ filename_txt = generate_filename(query + ' --- ' + response2, "py")
126
+ create_file(filename_txt, query, response2, should_save)
127
+
128
+ all = '# Query: ' + query + '# Response: ' + response + '# Response2: ' + response2
 
 
129
  filename_txt2 = generate_filename(query + ' --- ' + all, "md")
130
  create_file(filename_txt2, query, all, should_save)
 
131
  SpeechSynthesis(all)
132
  return all
133