update
Browse files
app.py
CHANGED
|
@@ -34,7 +34,7 @@ def generate_poem(text, style):
|
|
| 34 |
output[:, input_ids.shape[-1] :][0], skip_special_tokens=True
|
| 35 |
)
|
| 36 |
|
| 37 |
-
text = text + generated_text
|
| 38 |
|
| 39 |
# Post-process the output
|
| 40 |
text = text.replace("<unk>", "\n")
|
|
@@ -52,8 +52,8 @@ def generate_poem(text, style):
|
|
| 52 |
gradio_interface = gr.Interface(
|
| 53 |
fn=generate_poem,
|
| 54 |
inputs=[
|
| 55 |
-
gr.
|
| 56 |
-
gr.
|
| 57 |
choices=["Luc Bat", "Bay Chu", "Tam Chu", "Nam Chu"], label="Style"
|
| 58 |
),
|
| 59 |
],
|
|
|
|
| 34 |
output[:, input_ids.shape[-1] :][0], skip_special_tokens=True
|
| 35 |
)
|
| 36 |
|
| 37 |
+
text = text + " " + generated_text
|
| 38 |
|
| 39 |
# Post-process the output
|
| 40 |
text = text.replace("<unk>", "\n")
|
|
|
|
| 52 |
gradio_interface = gr.Interface(
|
| 53 |
fn=generate_poem,
|
| 54 |
inputs=[
|
| 55 |
+
gr.components.Textbox(lines=1, placeholder="First words of the poem"),
|
| 56 |
+
gr.components.Dropdown(
|
| 57 |
choices=["Luc Bat", "Bay Chu", "Tam Chu", "Nam Chu"], label="Style"
|
| 58 |
),
|
| 59 |
],
|