Spaces:
Build error
Build error
Begin putting finishing touches
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ TRANSLATE_TO_DEFAULT = "Don't translate"
|
|
18 |
PROMPT_TEMPLATE = PromptTemplate(
|
19 |
input_variables=["original_words", "num_words", "formality", "emotions", "translate_to"],
|
20 |
template="Express {num_words} in a {formality} manner, "
|
21 |
-
"{emotions} {translate_to} the following: \n{original_words}\n",
|
22 |
)
|
23 |
|
24 |
|
@@ -151,7 +151,7 @@ with block:
|
|
151 |
with gr.Row():
|
152 |
temperature_slider = gr.Slider(label="GPT Temperature", value=TEMPERATURE_DEFAULT, minimum=0.0, maximum=1.0,
|
153 |
step=0.1)
|
154 |
-
title = gr.Markdown("""<h3><center>GPT-3.5 Express-inator</center></h3>""")
|
155 |
openai_api_key_textbox = gr.Textbox(placeholder="Paste your OpenAI API key",
|
156 |
show_label=False, lines=1, type='password')
|
157 |
|
@@ -178,11 +178,11 @@ with block:
|
|
178 |
outputs=[formality_state])
|
179 |
|
180 |
translate_to_radio = gr.Radio(label="Translate to:", choices=[
|
181 |
-
"Arabic", "British English", "Chinese (Simplified)", "Chinese (Traditional)",
|
182 |
-
"
|
183 |
-
"
|
184 |
-
"
|
185 |
-
|
186 |
|
187 |
translate_to_radio.change(update_foo,
|
188 |
inputs=[translate_to_radio, translate_to_state],
|
@@ -245,6 +245,12 @@ with block:
|
|
245 |
inputs=[anger_level_radio, anger_level_state],
|
246 |
outputs=[anger_level_state])
|
247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
submit.click(desc2sheet,
|
249 |
inputs=[
|
250 |
request, openai_api_key_state, temperature_state, llm_chain_state, num_words_state,
|
|
|
18 |
PROMPT_TEMPLATE = PromptTemplate(
|
19 |
input_variables=["original_words", "num_words", "formality", "emotions", "translate_to"],
|
20 |
template="Express {num_words} in a {formality} manner, "
|
21 |
+
"{emotions} {translate_to} as a very funny joke with a setup and punchline, the following: \n{original_words}\n",
|
22 |
)
|
23 |
|
24 |
|
|
|
151 |
with gr.Row():
|
152 |
temperature_slider = gr.Slider(label="GPT Temperature", value=TEMPERATURE_DEFAULT, minimum=0.0, maximum=1.0,
|
153 |
step=0.1)
|
154 |
+
title = gr.Markdown ("""<h3><center>GPT-3.5 Express-inator</center></h3>""")
|
155 |
openai_api_key_textbox = gr.Textbox(placeholder="Paste your OpenAI API key",
|
156 |
show_label=False, lines=1, type='password')
|
157 |
|
|
|
178 |
outputs=[formality_state])
|
179 |
|
180 |
translate_to_radio = gr.Radio(label="Translate to:", choices=[
|
181 |
+
TRANSLATE_TO_DEFAULT, "Arabic", "British English", "Chinese (Simplified)", "Chinese (Traditional)",
|
182 |
+
"Czech", "Danish", "Dutch", "emojis", "English", "Finnish", "French", "Gen Z slang", "German", "Greek",
|
183 |
+
"Hebrew", "Hindi", "Hungarian", "Indonesian", "Italian", "Japanese", "Klingon", "Korean", "Norwegian",
|
184 |
+
"Old English", "Pirate", "Polish", "Portuguese", "Romanian", "Russian", "Spanish", "Swedish", "Thai",
|
185 |
+
"Turkish", "Vietnamese", "Yoda"], value=TRANSLATE_TO_DEFAULT)
|
186 |
|
187 |
translate_to_radio.change(update_foo,
|
188 |
inputs=[translate_to_radio, translate_to_state],
|
|
|
245 |
inputs=[anger_level_radio, anger_level_state],
|
246 |
outputs=[anger_level_state])
|
247 |
|
248 |
+
gr.HTML("""
|
249 |
+
<center>This app by <a target='_blank' href='https://twitter.com/JavaFXpert'>@JavaFXpert</a> leverages GPT-3.5 for text completion to facilitate expressing yourself.
|
250 |
+
The author is not responsible for the content of the generated text.</center>""")
|
251 |
+
|
252 |
+
gr.HTML("<center>Powered by <a href='https://github.com/hwchase17/langchain'>LangChain 🦜️🔗</a></center>")
|
253 |
+
|
254 |
submit.click(desc2sheet,
|
255 |
inputs=[
|
256 |
request, openai_api_key_state, temperature_state, llm_chain_state, num_words_state,
|