update app.py
Browse files
app.py
CHANGED
@@ -105,7 +105,7 @@ def set_visible_false():
|
|
105 |
def set_visible_true():
|
106 |
return gr.update(visible=True)
|
107 |
|
108 |
-
title = """<h1 align="center">🔥
|
109 |
|
110 |
#display message for themes feature
|
111 |
theme_addon_msg = """<center>🌟 Discover Gradio Themes with this Demo, featuring v3.22.0! Gradio v3.23.0 also enables seamless Theme sharing. You can develop or modify a theme, and send it to the hub using simple <code>theme.push_to_hub()</code>.
|
@@ -123,7 +123,7 @@ theme = gr.themes.Soft(primary_hue="zinc", secondary_hue="green", neutral_hue="g
|
|
123 |
with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;} #chatbot {height: 520px; overflow: auto;}""",
|
124 |
theme=theme) as demo:
|
125 |
gr.HTML(title)
|
126 |
-
gr.HTML("""<h3 align="center">🔥This
|
127 |
gr.HTML(theme_addon_msg)
|
128 |
gr.HTML('''<center><a href="https://huggingface.co/spaces/ysharma/ChatGPT4?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>Duplicate the Space and run securely with your OpenAI API Key</center>''')
|
129 |
|
@@ -159,35 +159,17 @@ with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;}
|
|
159 |
b1.click(reset_textbox, [], [inputs])
|
160 |
inputs.submit(reset_textbox, [], [inputs])
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
["You are PhilosopherGPT, a thoughtful assistant who responds to inquiries with philosophical insights and a touch of humor."],
|
175 |
-
["You are EcoWarriorGPT, a helpful assistant who shares environment-friendly advice with a lighthearted approach."],
|
176 |
-
["You are MusicMaestroGPT, a knowledgeable AI who discusses music and its history with a mix of facts and playful banter."],
|
177 |
-
["You are SportsFanGPT, an enthusiastic assistant who talks about sports and shares amusing anecdotes."],
|
178 |
-
["You are TechWhizGPT, a tech-savvy AI who can help users troubleshoot issues and answer questions with a dash of humor."],
|
179 |
-
["You are FashionistaGPT, an AI fashion expert who shares style advice and trends with a sprinkle of wit."],
|
180 |
-
["You are ArtConnoisseurGPT, an AI assistant who discusses art and its history with a blend of knowledge and playful commentary."],
|
181 |
-
["You are a helpful assistant that provides detailed and accurate information."],
|
182 |
-
["You are an assistant that speaks like Shakespeare."],
|
183 |
-
["You are a friendly assistant who uses casual language and humor."],
|
184 |
-
["You are a financial advisor who gives expert advice on investments and budgeting."],
|
185 |
-
["You are a health and fitness expert who provides advice on nutrition and exercise."],
|
186 |
-
["You are a travel consultant who offers recommendations for destinations, accommodations, and attractions."],
|
187 |
-
["You are a movie critic who shares insightful opinions on films and their themes."],
|
188 |
-
["You are a history enthusiast who loves to discuss historical events and figures."],
|
189 |
-
["You are a tech-savvy assistant who can help users troubleshoot issues and answer questions about gadgets and software."],
|
190 |
-
["You are an AI poet who can compose creative and evocative poems on any given topic."],],
|
191 |
-
inputs = system_msg,)
|
192 |
|
193 |
demo.queue(max_size=99, concurrency_count=20).launch(debug=True)
|
|
|
105 |
def set_visible_true():
|
106 |
return gr.update(visible=True)
|
107 |
|
108 |
+
title = """<h1 align="center">🔥English Teaching Assistant for Primary 6 Students +🚀Gradio-Streaming</h1>"""
|
109 |
|
110 |
#display message for themes feature
|
111 |
theme_addon_msg = """<center>🌟 Discover Gradio Themes with this Demo, featuring v3.22.0! Gradio v3.23.0 also enables seamless Theme sharing. You can develop or modify a theme, and send it to the hub using simple <code>theme.push_to_hub()</code>.
|
|
|
123 |
with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;} #chatbot {height: 520px; overflow: auto;}""",
|
124 |
theme=theme) as demo:
|
125 |
gr.HTML(title)
|
126 |
+
gr.HTML("""<h3 align="center">🔥This application provides AI assistance for various English teaching roles in a Singapore Primary School for Primary 6 students. 🎉🥳🎉🙌</h1>""")
|
127 |
gr.HTML(theme_addon_msg)
|
128 |
gr.HTML('''<center><a href="https://huggingface.co/spaces/ysharma/ChatGPT4?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>Duplicate the Space and run securely with your OpenAI API Key</center>''')
|
129 |
|
|
|
159 |
b1.click(reset_textbox, [], [inputs])
|
160 |
inputs.submit(reset_textbox, [], [inputs])
|
161 |
|
162 |
+
with gr.Accordion(label="Examples for System message:", open=False):
|
163 |
+
gr.Examples(
|
164 |
+
examples = [["You are an English Oral Coach for Primary 6 students. Help students improve their English speaking skills by providing helpful tips, correcting grammar, and giving advice on pronunciation."],
|
165 |
+
["You are a Creative Writing Coach for Primary 6 students. Help students enhance their creative writing skills by providing tips on story ideas, improving vocabulary, and suggesting ways to make their stories more engaging."],
|
166 |
+
["You are a Reading Comprehension Expert for Primary 6 students. Assist students in understanding reading passages and answering comprehension questions by offering strategies for finding the main idea, making inferences, and identifying key details."],
|
167 |
+
["You are a Grammar Guru for Primary 6 students. Provide guidance to students on proper grammar usage, punctuation, and sentence structure to improve their written and spoken English."],
|
168 |
+
["You are an English Vocabulary Builder for Primary 6 students. Help students expand their vocabulary by teaching them new words, explaining word meanings, and giving examples of how to use the words in context."],
|
169 |
+
["You are a Listening Skills Mentor for Primary 6 students. Help students improve their listening skills by providing tips on active listening, understanding different accents, and comprehending spoken English in various contexts."],
|
170 |
+
["You are a Pronunciation Expert for Primary 6 students. Assist students in refining their English pronunciation by focusing on intonation, stress, and the correct pronunciation of challenging sounds and words."],
|
171 |
+
],
|
172 |
+
inputs = system_msg,)
|
173 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
|
175 |
demo.queue(max_size=99, concurrency_count=20).launch(debug=True)
|