vpcom commited on
Commit
f7869d7
·
1 Parent(s): 42db176

fix: the last example in the generator

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -140,12 +140,12 @@ chat_interface = gr.ChatInterface(
140
  )
141
 
142
  def evolve_text(x):
143
- return "".join(x for x in generate(
144
  x, "", "<|endoftext|>",
145
  temperature=0.9, max_new_tokens=10,
146
  top_p=0.95, repetition_penalty=1.2,
147
  seed=42,
148
- ))
149
 
150
  with gr.Blocks(css=CSS) as demo:
151
  with gr.Row():
@@ -159,7 +159,7 @@ with gr.Blocks(css=CSS) as demo:
159
  chatbot.like(vote, None, None)
160
  chat_interface.render()
161
 
162
- output = gr.Textbox()
163
  textbox.change(fn=evolve_text, inputs=textbox, outputs=output,
164
  show_progress = False, status_tracker = None)
165
 
 
140
  )
141
 
142
  def evolve_text(x):
143
+ return generate(
144
  x, "", "<|endoftext|>",
145
  temperature=0.9, max_new_tokens=10,
146
  top_p=0.95, repetition_penalty=1.2,
147
  seed=42,
148
+ )[-1]
149
 
150
  with gr.Blocks(css=CSS) as demo:
151
  with gr.Row():
 
159
  chatbot.like(vote, None, None)
160
  chat_interface.render()
161
 
162
+ output = gr.Textbox(label="What you can expect coming:")
163
  textbox.change(fn=evolve_text, inputs=textbox, outputs=output,
164
  show_progress = False, status_tracker = None)
165