Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -57,72 +57,17 @@ st.set_page_config(
|
|
57 |
|
58 |
experimentalSubProgram="""
|
59 |
|
60 |
-
|
61 |
-
|
62 |
import streamlit as st
|
63 |
import random
|
64 |
import numpy as np
|
65 |
|
66 |
-
# Define game steps with detailed descriptions and emojis
|
67 |
-
game_steps = [
|
68 |
-
("Choose your character and AI assistant.", "✨"),
|
69 |
-
("Explore the futuristic cityscape and uncover hidden secrets.", "🔍"),
|
70 |
-
("Engage in intense battles with rogue AI entities.", "⚔️"),
|
71 |
-
("Solve complex puzzles using your AI augmentation.", "🧩"),
|
72 |
-
("Make critical decisions that affect the outcome of the story.", "🤔"),
|
73 |
-
("Uncover the truth behind the mysterious disappearance of top scientists.", "🕵️♂️"),
|
74 |
-
("Confront the ultimate AI villain in a thrilling showdown.", "💥"),
|
75 |
-
("Determine the fate of humanity with your AI-enhanced abilities.", "🌎"),
|
76 |
-
]
|
77 |
-
|
78 |
-
# Randomly generate outcomes with emoji representations
|
79 |
-
def generate_outcome(step):
|
80 |
-
outcomes = {
|
81 |
-
1: ["🦸♂️ Hero's Journey Begins", "🤖 Cyborg Companion Chosen"],
|
82 |
-
2: ["🌃 Neon Nights Unfold", "🔑 Secret Unearthed"],
|
83 |
-
3: ["🔥 Battle Blazes", "🛡️ Tactical Retreat"],
|
84 |
-
4: ["🧠 Puzzle Master", "💡 Aha Moment"],
|
85 |
-
5: ["🚪 Path Chosen", "🔄 Fate Twisted"],
|
86 |
-
6: ["🔬 Scientist Found", "📜 Clue Discovered"],
|
87 |
-
7: ["👑 Villain Vanquished", "🚀 Escape Narrow"],
|
88 |
-
8: ["🌍 New Dawn for Humanity", "💔 Dystopia Deepens"],
|
89 |
-
}
|
90 |
-
# Return a random outcome based on the step
|
91 |
-
return random.choice(outcomes[step])
|
92 |
-
|
93 |
-
# Display method steps of play with randomized outcomes
|
94 |
-
def display_game_steps():
|
95 |
-
st.title("Cyberpunk Adventure Game")
|
96 |
-
st.header("Method Steps of Play")
|
97 |
-
|
98 |
-
for i, (description, emoji) in enumerate(game_steps, start=1):
|
99 |
-
with st.container():
|
100 |
-
col1, col2 = st.columns([3, 1])
|
101 |
-
with col1:
|
102 |
-
st.markdown(f"**Step {i}.** {description}")
|
103 |
-
with col2:
|
104 |
-
st.markdown(emoji)
|
105 |
-
|
106 |
-
# Generate and display a random outcome for the step
|
107 |
-
outcome = generate_outcome(i)
|
108 |
-
st.info(f"Outcome: {outcome}")
|
109 |
-
|
110 |
-
# Main app function
|
111 |
-
def main():
|
112 |
-
display_game_steps()
|
113 |
-
|
114 |
-
if __name__ == "__main__":
|
115 |
-
main()
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
"""
|
120 |
|
121 |
|
122 |
|
123 |
PromptPrefix = 'Create a markdown outline and table with appropriate emojis for graphic novel rules defining the method steps of play for topic of '
|
124 |
-
PromptPrefix2 = 'Create a streamlit python user app. Show full code listing. Create a UI implementing storytelling features using plot twists
|
125 |
-
PromptPrefix2 = PromptPrefix2 + experimentalSubProgram # Super meta program!
|
126 |
|
127 |
|
128 |
st.markdown('''### 📖✨🔍 GraphicNovelAI ''')
|
@@ -278,30 +223,17 @@ def FileSidebar():
|
|
278 |
if next_action=='md':
|
279 |
st.markdown(file_contents)
|
280 |
|
281 |
-
buttonlabel = '🔍Run
|
282 |
if st.button(key='RunWithLlamaandGPT', label = buttonlabel):
|
283 |
user_prompt = file_contents
|
284 |
-
|
285 |
-
# Llama versus GPT Battle!
|
286 |
-
all=""
|
287 |
-
try:
|
288 |
-
st.write('🔍Running with Llama.')
|
289 |
-
response = StreamLLMChatResponse(file_contents)
|
290 |
-
filename = generate_filename(user_prompt, "md")
|
291 |
-
create_file(filename, file_contents, response, should_save)
|
292 |
-
all=response
|
293 |
-
#SpeechSynthesis(response)
|
294 |
-
except:
|
295 |
-
st.markdown('Llama is sleeping. Restart ETA 30 seconds.')
|
296 |
-
|
297 |
# gpt
|
298 |
try:
|
299 |
-
st.write('🔍Running
|
300 |
response2 = chat_with_model(user_prompt, file_contents, model_choice)
|
301 |
filename2 = generate_filename(file_contents, choice)
|
302 |
create_file(filename2, user_prompt, response, should_save)
|
303 |
-
all=
|
304 |
-
#SpeechSynthesis(response2)
|
305 |
except:
|
306 |
st.markdown('GPT is sleeping. Restart ETA 30 seconds.')
|
307 |
|
@@ -310,30 +242,17 @@ def FileSidebar():
|
|
310 |
|
311 |
if next_action=='search':
|
312 |
file_content_area = st.text_area("File Contents:", file_contents, height=500)
|
313 |
-
st.write('🔍Running
|
314 |
|
315 |
user_prompt = file_contents
|
316 |
-
|
317 |
-
# Llama versus GPT Battle!
|
318 |
-
all=""
|
319 |
-
try:
|
320 |
-
st.write('🔍Running with Llama.')
|
321 |
-
response = StreamLLMChatResponse(file_contents)
|
322 |
-
filename = generate_filename(user_prompt, ".md")
|
323 |
-
create_file(filename, file_contents, response, should_save)
|
324 |
-
all=response
|
325 |
-
#SpeechSynthesis(response)
|
326 |
-
except:
|
327 |
-
st.markdown('Llama is sleeping. Restart ETA 30 seconds.')
|
328 |
-
|
329 |
# gpt
|
330 |
try:
|
331 |
st.write('🔍Running with GPT.')
|
332 |
response2 = chat_with_model(user_prompt, file_contents, model_choice)
|
333 |
filename2 = generate_filename(file_contents, choice)
|
334 |
create_file(filename2, user_prompt, response, should_save)
|
335 |
-
all=
|
336 |
-
#SpeechSynthesis(response2)
|
337 |
except:
|
338 |
st.markdown('GPT is sleeping. Restart ETA 30 seconds.')
|
339 |
|
|
|
57 |
|
58 |
experimentalSubProgram="""
|
59 |
|
|
|
|
|
60 |
import streamlit as st
|
61 |
import random
|
62 |
import numpy as np
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
"""
|
65 |
|
66 |
|
67 |
|
68 |
PromptPrefix = 'Create a markdown outline and table with appropriate emojis for graphic novel rules defining the method steps of play for topic of '
|
69 |
+
PromptPrefix2 = 'Create a streamlit python user app. Show full code listing. Create a UI implementing storytelling features using plot twists and recurring interesting named characters with genius traits and file IO, randomness, ten point choice lists, math distribution tradeoffs, witty humorous dilemnas with emoji , rewards, variables, reusable functions with parameters, and data driven app with python libraries and streamlit components for Javascript and HTML5. Use appropriate emojis for labels to summarize and list parts, function, conditions for topic: '
|
70 |
+
#PromptPrefix2 = PromptPrefix2 + experimentalSubProgram # Super meta program!
|
71 |
|
72 |
|
73 |
st.markdown('''### 📖✨🔍 GraphicNovelAI ''')
|
|
|
223 |
if next_action=='md':
|
224 |
st.markdown(file_contents)
|
225 |
|
226 |
+
buttonlabel = '🔍Run'
|
227 |
if st.button(key='RunWithLlamaandGPT', label = buttonlabel):
|
228 |
user_prompt = file_contents
|
229 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
# gpt
|
231 |
try:
|
232 |
+
st.write('🔍Running..')
|
233 |
response2 = chat_with_model(user_prompt, file_contents, model_choice)
|
234 |
filename2 = generate_filename(file_contents, choice)
|
235 |
create_file(filename2, user_prompt, response, should_save)
|
236 |
+
all=response2
|
|
|
237 |
except:
|
238 |
st.markdown('GPT is sleeping. Restart ETA 30 seconds.')
|
239 |
|
|
|
242 |
|
243 |
if next_action=='search':
|
244 |
file_content_area = st.text_area("File Contents:", file_contents, height=500)
|
245 |
+
st.write('🔍Running..')
|
246 |
|
247 |
user_prompt = file_contents
|
248 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
# gpt
|
250 |
try:
|
251 |
st.write('🔍Running with GPT.')
|
252 |
response2 = chat_with_model(user_prompt, file_contents, model_choice)
|
253 |
filename2 = generate_filename(file_contents, choice)
|
254 |
create_file(filename2, user_prompt, response, should_save)
|
255 |
+
all=response2
|
|
|
256 |
except:
|
257 |
st.markdown('GPT is sleeping. Restart ETA 30 seconds.')
|
258 |
|