awacke1 commited on
Commit
79db155
·
verified ·
1 Parent(s): aa1aff0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -29
app.py CHANGED
@@ -64,6 +64,35 @@ import numpy as np
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 use three emoji appropriate short text 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: '
@@ -709,35 +738,6 @@ def add_witty_humor_buttons():
709
  if col7[0].button("Top Ten Best Write a streamlit python program prompts to build AI programs. 🎙️"):
710
  StreamLLMChatResponse(descriptions["Top Ten Best Write a streamlit python program prompts to build AI programs. 🎙️"])
711
 
712
- def SpeechSynthesis(result):
713
- documentHTML5='''
714
- <!DOCTYPE html>
715
- <html>
716
- <head>
717
- <title>Read It Aloud</title>
718
- <script type="text/javascript">
719
- function readAloud() {
720
- const text = document.getElementById("textArea").value;
721
- const speech = new SpeechSynthesisUtterance(text);
722
- window.speechSynthesis.speak(speech);
723
- }
724
- </script>
725
- </head>
726
- <body>
727
- <h1>🔊 Read It Aloud</h1>
728
- <textarea id="textArea" rows="10" cols="80">
729
- '''
730
- documentHTML5 = documentHTML5 + result
731
- documentHTML5 = documentHTML5 + '''
732
- </textarea>
733
- <br>
734
- <button onclick="readAloud()">🔊 Read Aloud</button>
735
- </body>
736
- </html>
737
- '''
738
-
739
- components.html(documentHTML5, width=1280, height=300)
740
- #return result
741
 
742
 
743
  # 3. Stream Llama Response
 
64
  """
65
 
66
 
67
+ def SpeechSynthesis(result):
68
+ documentHTML5='''
69
+ <!DOCTYPE html>
70
+ <html>
71
+ <head>
72
+ <title>Read It Aloud</title>
73
+ <script type="text/javascript">
74
+ function readAloud() {
75
+ const text = document.getElementById("textArea").value;
76
+ const speech = new SpeechSynthesisUtterance(text);
77
+ window.speechSynthesis.speak(speech);
78
+ }
79
+ </script>
80
+ </head>
81
+ <body>
82
+ <h1>🔊 Read It Aloud</h1>
83
+ <textarea id="textArea" rows="10" cols="80">
84
+ '''
85
+ documentHTML5 = documentHTML5 + result
86
+ documentHTML5 = documentHTML5 + '''
87
+ </textarea>
88
+ <br>
89
+ <button onclick="readAloud()">🔊 Read Aloud</button>
90
+ </body>
91
+ </html>
92
+ '''
93
+
94
+ components.html(documentHTML5, width=1280, height=300)
95
+ #return result
96
 
97
  PromptPrefix = 'Create a markdown outline and table with appropriate emojis for graphic novel rules defining the method steps of play for topic of '
98
  PromptPrefix2 = 'Create a streamlit python user app. Show full code listing. Create a UI implementing storytelling, features use three emoji appropriate short text 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: '
 
738
  if col7[0].button("Top Ten Best Write a streamlit python program prompts to build AI programs. 🎙️"):
739
  StreamLLMChatResponse(descriptions["Top Ten Best Write a streamlit python program prompts to build AI programs. 🎙️"])
740
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
741
 
742
 
743
  # 3. Stream Llama Response