phamson02 commited on
Commit
37e19c1
1 Parent(s): 400d16a
Files changed (1) hide show
  1. app.py +3 -3
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.inputs.Textbox(lines=1, placeholder="First words of the poem"),
56
- gr.inputs.Dropdown(
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
  ],