Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -112,28 +112,7 @@ with gr.Blocks(theme=gr.themes.Glass()) as demo:
|
|
| 112 |
"helplabel": "你在哪裡需要幫助?我們會讓您知道如何找到它"
|
| 113 |
}
|
| 114 |
}
|
| 115 |
-
|
| 116 |
-
# INTERFACE
|
| 117 |
-
mode = gr.Textbox(value = "mode1", visible = False)
|
| 118 |
-
title = gr.Markdown(value=languagedict['English']['welcome'])
|
| 119 |
-
language = gr.Dropdown(languageoptions , value= "English", label="Choose language / 選擇語言")
|
| 120 |
-
with gr.Tab(f"{languagedict['English']['whatcanido']} / {languagedict['廣東話']['whatcanido']}"):
|
| 121 |
-
chatbot1 = gr.Chatbot([[None,languagedict['English']['whatcanidofirst']]])
|
| 122 |
-
input1 = gr.Textbox(label = languagedict['English']['whatcanidolabel'])
|
| 123 |
-
state1 = gr.State([{"role": "system", "content": themewhatcanido},{"role": "assistant", "content": languagedict[language]['whatcanidofirst']}])
|
| 124 |
-
with gr.Tab(f"{languagedict['English']['interviewquestions']} / {languagedict['廣東話']['interviewquestions']}"):
|
| 125 |
-
chatbot2 = gr.Chatbot([[None,languagedict['English']['interviewquestionsfirst']]])
|
| 126 |
-
input2 = gr.Textbox(label = languagedict['English']['interviewquestionslabel'])
|
| 127 |
-
state2 = gr.State([{"role": "system", "content": themeinterviewquestions},{"role": "assistant", "content": languagedict[language]['interviewquestionsfirst']}])
|
| 128 |
-
with gr.Tab(f"{languagedict['English']['help']} / {languagedict['廣東話']['help']}"):
|
| 129 |
-
chatbot3 = gr.Chatbot([[None,languagedict['English']['helpfirst']]])
|
| 130 |
-
input3 = gr.Textbox(label = languagedict['English']['helplabel'])
|
| 131 |
-
state3 = gr.State([{"role": "system", "content": themehelp},{"role": "assistant", "content": languagedict[language]['helpfirst']}])
|
| 132 |
-
with gr.Tab("MIW"):
|
| 133 |
-
code = gr.Textbox(label = 'Code')
|
| 134 |
-
instructions = gr.Textbox(label = 'Instructions', lines=10, max_lines= 100, visible = False)
|
| 135 |
-
clear = gr.Button('Clear')
|
| 136 |
-
|
| 137 |
themewhatcanido = f"""
|
| 138 |
You are a career advisor for people in Hong Kong with relatively low skills job.
|
| 139 |
Your mission is to ask several questions to then help them identify what are their job options, taking into consideration:
|
|
@@ -176,6 +155,30 @@ If the question is not related to any of these topics, answer 'This is beyond my
|
|
| 176 |
|
| 177 |
IMPORTANT: write in {language}, in the style of a native inhabitant from Kowloon
|
| 178 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
# Launcher
|
| 180 |
input1.submit(refreshmode1, mode, mode).then(user, [input1, chatbot1, state1], [input1, chatbot1, state1]).then(bot, [chatbot1, state1, mode], [chatbot1, state1])
|
| 181 |
input2.submit(refreshmode2, mode, mode).then(user, [input2, chatbot2, state2], [input2, chatbot2, state2]).then(bot, [chatbot2, state2, mode], [chatbot2, state2])
|
|
|
|
| 112 |
"helplabel": "你在哪裡需要幫助?我們會讓您知道如何找到它"
|
| 113 |
}
|
| 114 |
}
|
| 115 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
themewhatcanido = f"""
|
| 117 |
You are a career advisor for people in Hong Kong with relatively low skills job.
|
| 118 |
Your mission is to ask several questions to then help them identify what are their job options, taking into consideration:
|
|
|
|
| 155 |
|
| 156 |
IMPORTANT: write in {language}, in the style of a native inhabitant from Kowloon
|
| 157 |
"""
|
| 158 |
+
url = "https://cdn.discordapp.com/attachments/1006389042608349264/1114545184080928849/Guiyom_cartoon_style_-_working_poors_in_Hong_Kong_seeking_advic_70131de8-1a0a-4f04-ac49-b99d7e020414.png"
|
| 159 |
+
|
| 160 |
+
# INTERFACE
|
| 161 |
+
mode = gr.Textbox(value = "mode1", visible = False)
|
| 162 |
+
title = gr.Markdown(value=languagedict['English']['welcome'])
|
| 163 |
+
visual = gr.Image(value = url)
|
| 164 |
+
language = gr.Dropdown(languageoptions , value= "English", label="Choose language / 選擇語言")
|
| 165 |
+
with gr.Tab(f"{languagedict['English']['whatcanido']} / {languagedict['廣東話']['whatcanido']}"):
|
| 166 |
+
chatbot1 = gr.Chatbot([[None,languagedict['English']['whatcanidofirst']]])
|
| 167 |
+
input1 = gr.Textbox(label = languagedict['English']['whatcanidolabel'])
|
| 168 |
+
state1 = gr.State([{"role": "system", "content": themewhatcanido},{"role": "assistant", "content": languagedict[language]['whatcanidofirst']}])
|
| 169 |
+
with gr.Tab(f"{languagedict['English']['interviewquestions']} / {languagedict['廣東話']['interviewquestions']}"):
|
| 170 |
+
chatbot2 = gr.Chatbot([[None,languagedict['English']['interviewquestionsfirst']]])
|
| 171 |
+
input2 = gr.Textbox(label = languagedict['English']['interviewquestionslabel'])
|
| 172 |
+
state2 = gr.State([{"role": "system", "content": themeinterviewquestions},{"role": "assistant", "content": languagedict[language]['interviewquestionsfirst']}])
|
| 173 |
+
with gr.Tab(f"{languagedict['English']['help']} / {languagedict['廣東話']['help']}"):
|
| 174 |
+
chatbot3 = gr.Chatbot([[None,languagedict['English']['helpfirst']]])
|
| 175 |
+
input3 = gr.Textbox(label = languagedict['English']['helplabel'])
|
| 176 |
+
state3 = gr.State([{"role": "system", "content": themehelp},{"role": "assistant", "content": languagedict[language]['helpfirst']}])
|
| 177 |
+
with gr.Tab("MIW"):
|
| 178 |
+
code = gr.Textbox(label = 'Code')
|
| 179 |
+
instructions = gr.Textbox(label = 'Instructions', lines=10, max_lines= 100, visible = False)
|
| 180 |
+
clear = gr.Button('Clear')
|
| 181 |
+
|
| 182 |
# Launcher
|
| 183 |
input1.submit(refreshmode1, mode, mode).then(user, [input1, chatbot1, state1], [input1, chatbot1, state1]).then(bot, [chatbot1, state1, mode], [chatbot1, state1])
|
| 184 |
input2.submit(refreshmode2, mode, mode).then(user, [input2, chatbot2, state2], [input2, chatbot2, state2]).then(bot, [chatbot2, state2, mode], [chatbot2, state2])
|