vpcom commited on
Commit
53ad3b6
·
1 Parent(s): 25783c2

feat: let's see if we can add an autocomplete functionality

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -139,6 +139,14 @@ chat_interface = gr.ChatInterface(
139
  additional_inputs=additional_inputs
140
  )
141
 
 
 
 
 
 
 
 
 
142
  with gr.Blocks(css=CSS) as demo:
143
  with gr.Row():
144
  with gr.Column():
@@ -151,6 +159,8 @@ with gr.Blocks(css=CSS) as demo:
151
  chatbot.like(vote, None, None)
152
  chat_interface.render()
153
 
154
- #textbox.change(fn=show_text, inputs=input, outputs=output, show_progress = True, status_tracker = None)
 
 
155
 
156
  demo.queue(concurrency_count=100, api_open=False).launch(show_api=False) #, share=True)
 
139
  additional_inputs=additional_inputs
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
+ )
149
+
150
  with gr.Blocks(css=CSS) as demo:
151
  with gr.Row():
152
  with gr.Column():
 
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
 
166
  demo.queue(concurrency_count=100, api_open=False).launch(show_api=False) #, share=True)