vpcom commited on
Commit
99388f0
·
1 Parent(s): b067bb0

fix: for now use another textbox

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -142,16 +142,16 @@ chat_interface = gr.ChatInterface(
142
  cache_examples=False,
143
  )
144
 
145
- def evolve_text(textbox, additional_inputs):
146
 
147
  possible_generation = "".join([x for x in generate(
148
- textbox.value, "", "<|endoftext|>",
149
  temperature=0.9, max_new_tokens=10,
150
  top_p=0.95, repetition_penalty=1.2,
151
  seed=42,
152
  )][-1]) #TODO: need a smarter way to do this
153
 
154
- textbox.info = possible_generation
155
 
156
  with gr.Blocks(css=CSS) as demo:
157
  with gr.Row():
@@ -164,8 +164,8 @@ with gr.Blocks(css=CSS) as demo:
164
 
165
  chatbot.like(vote, None, None)
166
 
167
- #output = gr.Textbox(label="What you can expect coming:")
168
- textbox.change(fn=evolve_text, inputs=[textbox],
169
  show_progress = False, status_tracker = None)
170
 
171
  #textbox.render()
 
142
  cache_examples=False,
143
  )
144
 
145
+ def evolve_text(textbox):
146
 
147
  possible_generation = "".join([x for x in generate(
148
+ textbox, "", "<|endoftext|>",
149
  temperature=0.9, max_new_tokens=10,
150
  top_p=0.95, repetition_penalty=1.2,
151
  seed=42,
152
  )][-1]) #TODO: need a smarter way to do this
153
 
154
+ return possible_generation
155
 
156
  with gr.Blocks(css=CSS) as demo:
157
  with gr.Row():
 
164
 
165
  chatbot.like(vote, None, None)
166
 
167
+ output = gr.Textbox(label="What you can expect coming:")
168
+ textbox.change(fn=evolve_text, inputs=textbox, outputs=output,
169
  show_progress = False, status_tracker = None)
170
 
171
  #textbox.render()