youngtsai commited on
Commit
f6fe762
·
1 Parent(s): 1d7518e
Files changed (1) hide show
  1. app.py +15 -18
app.py CHANGED
@@ -194,20 +194,22 @@ with gr.Blocks() as demo:
194
  Make sure the vocabulary you use is at english level.
195
  """
196
  user_generate_topics_prompt = gr.Textbox(label="Topics Prompt", value=default_generate_topics_prompt)
197
- generate_topics_button = gr.Button("Generate Topic Sentences")
 
 
198
 
199
  gr.Markdown("## 3. Generate Points")
200
- topic_input = gr.Textbox(label="Topic")
201
  default_generate_points_prompt = """
202
  Please provide main points to develop in a paragraph about topic in the context of scenario,
203
  use simple English language and make sure the vocabulary you use is at eng_level.
204
  No more explanation either no developing these points into a simple paragraph.
205
  """
206
  user_generate_points_prompt = gr.Textbox(label="Points Prompt", value=default_generate_points_prompt)
207
- generate_points_button = gr.Button("Generate Points")
 
 
208
 
209
  gr.Markdown("## 4. Generate Topic Sentences")
210
- points_input = gr.Textbox(label="Points")
211
  default_generate_topic_sentences_prompt = """
212
  Please provide one appropriate topic sentence that aptly introduces the subject for the given scenario and topic.
213
  Additionally, provide two topic sentences that, while related to the topic,
@@ -225,10 +227,11 @@ with gr.Blocks() as demo:
225
  }}
226
  """
227
  user_generate_topic_sentences_prompt = gr.Textbox(label="Topic Sentences Prompt", value=default_generate_topic_sentences_prompt)
228
- generate_topic_sentences_button = gr.Button("Generate Topic Sentences")
 
 
229
 
230
  gr.Markdown("## 5. Generate Supporting Sentence 支持句")
231
- topic_sentence_input = gr.Textbox(label="Topic Sentences")
232
  default_generate_supporting_sentences_prompt = """
233
  I'm aiming to improve my writing. I have a topic sentence as topic_sentence_input.
234
  Please assist me by "Developing supporting detials" based on the keyword: points to write three sentences as an example.
@@ -239,10 +242,11 @@ with gr.Blocks() as demo:
239
  Total word-count is around 50. no more explanation either no more extra non-relation sentences.
240
  """
241
  user_generate_supporting_sentences_prompt = gr.Textbox(label="Supporting Sentences Prompt", value=default_generate_supporting_sentences_prompt)
242
- generate_supporting_sentences_button = gr.Button("Generate Supporting Sentences")
 
 
243
 
244
  gr.Markdown("## 6. Conclusion sentence 結論句")
245
- supporting_sentences_input = gr.Textbox(label="Supporting Sentences")
246
  default_generate_conclusion_sentence_prompt = """
247
  I'm aiming to improve my writing.
248
  By the topic sentence, please assist me by "Developing conclusion sentences"
@@ -254,19 +258,12 @@ with gr.Blocks() as demo:
254
  Total word-count is around 20.
255
  """
256
  user_generate_conclusion_sentence_prompt = gr.Textbox(label="Conclusion Sentence Prompt", value=default_generate_conclusion_sentence_prompt)
257
- generate_conclusion_sentence_button = gr.Button("Generate Conclusion Sentence")
 
 
258
 
259
  gr.Markdown("## 7. Paragraph Integration and Revision")
260
- conclusion_sentence_input = gr.Textbox(label="Conclusion Sentence")
261
  generate_paragraph_button = gr.Button("Generate Paragraph")
262
-
263
-
264
- with gr.Column():
265
- topic_output = gr.Textbox(label="Generated Topic 主題")
266
- points_output = gr.Textbox(label="Generated Points 要點")
267
- topic_sentence_output = gr.Textbox(label="Generated Topic Sentences 主題句")
268
- supporting_sentences_output = gr.Textbox(label="Generated Supporting Sentences 支持句")
269
- conclusion_sentence_output = gr.Textbox(label="Generated Conclusion Sentence 結論句")
270
  paragraph_output = gr.Textbox(label="Generated Paragraph 完整段落")
271
 
272
  generate_topics_button.click(
 
194
  Make sure the vocabulary you use is at english level.
195
  """
196
  user_generate_topics_prompt = gr.Textbox(label="Topics Prompt", value=default_generate_topics_prompt)
197
+ generate_topics_button = gr.Button("AI Generate Topic Sentences")
198
+ topic_output = gr.Textbox(label="AI Generated Topic 主題")
199
+ topic_input = gr.Textbox(label="Topic")
200
 
201
  gr.Markdown("## 3. Generate Points")
 
202
  default_generate_points_prompt = """
203
  Please provide main points to develop in a paragraph about topic in the context of scenario,
204
  use simple English language and make sure the vocabulary you use is at eng_level.
205
  No more explanation either no developing these points into a simple paragraph.
206
  """
207
  user_generate_points_prompt = gr.Textbox(label="Points Prompt", value=default_generate_points_prompt)
208
+ generate_points_button = gr.Button("AI Generate Points")
209
+ points_output = gr.Textbox(label="AI Generated Points 要點")
210
+ points_input = gr.Textbox(label="Points")
211
 
212
  gr.Markdown("## 4. Generate Topic Sentences")
 
213
  default_generate_topic_sentences_prompt = """
214
  Please provide one appropriate topic sentence that aptly introduces the subject for the given scenario and topic.
215
  Additionally, provide two topic sentences that, while related to the topic,
 
227
  }}
228
  """
229
  user_generate_topic_sentences_prompt = gr.Textbox(label="Topic Sentences Prompt", value=default_generate_topic_sentences_prompt)
230
+ generate_topic_sentences_button = gr.Button("AI Generate Topic Sentences")
231
+ topic_sentence_output = gr.Textbox(label="AI Generated Topic Sentences 主題句")
232
+ topic_sentence_input = gr.Textbox(label="Topic Sentences")
233
 
234
  gr.Markdown("## 5. Generate Supporting Sentence 支持句")
 
235
  default_generate_supporting_sentences_prompt = """
236
  I'm aiming to improve my writing. I have a topic sentence as topic_sentence_input.
237
  Please assist me by "Developing supporting detials" based on the keyword: points to write three sentences as an example.
 
242
  Total word-count is around 50. no more explanation either no more extra non-relation sentences.
243
  """
244
  user_generate_supporting_sentences_prompt = gr.Textbox(label="Supporting Sentences Prompt", value=default_generate_supporting_sentences_prompt)
245
+ generate_supporting_sentences_button = gr.Button("AI Generate Supporting Sentences")
246
+ supporting_sentences_output = gr.Textbox(label="AI Generated Supporting Sentences 支持句")
247
+ supporting_sentences_input = gr.Textbox(label="Supporting Sentences")
248
 
249
  gr.Markdown("## 6. Conclusion sentence 結論句")
 
250
  default_generate_conclusion_sentence_prompt = """
251
  I'm aiming to improve my writing.
252
  By the topic sentence, please assist me by "Developing conclusion sentences"
 
258
  Total word-count is around 20.
259
  """
260
  user_generate_conclusion_sentence_prompt = gr.Textbox(label="Conclusion Sentence Prompt", value=default_generate_conclusion_sentence_prompt)
261
+ generate_conclusion_sentence_button = gr.Button("AI Generate Conclusion Sentence")
262
+ conclusion_sentence_output = gr.Textbox(label="AI Generated Conclusion Sentence 結論句")
263
+ conclusion_sentence_input = gr.Textbox(label="Conclusion Sentence")
264
 
265
  gr.Markdown("## 7. Paragraph Integration and Revision")
 
266
  generate_paragraph_button = gr.Button("Generate Paragraph")
 
 
 
 
 
 
 
 
267
  paragraph_output = gr.Textbox(label="Generated Paragraph 完整段落")
268
 
269
  generate_topics_button.click(