vpcom commited on
Commit
62690c8
1 Parent(s): f7869d7

fix: show a demo before sending the text in the chatbox

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -126,8 +126,10 @@ p {direction: rtl; white-space: pre-line;}
126
  chatbot = gr.Chatbot(bubble_full_width = False)
127
  textbox = gr.Textbox(
128
  label="textbox",
 
 
129
  lines=3,
130
- min_width=450,
131
  placeholder="...Type something here",
132
  rtl=True,
133
  )
@@ -136,16 +138,17 @@ chat_interface = gr.ChatInterface(
136
  chatbot=chatbot,
137
  textbox=textbox,
138
  examples=examples,
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
- )[-1]
149
 
150
  with gr.Blocks(css=CSS) as demo:
151
  with gr.Row():
 
126
  chatbot = gr.Chatbot(bubble_full_width = False)
127
  textbox = gr.Textbox(
128
  label="textbox",
129
+ container=False,
130
+ show_label=False,
131
  lines=3,
132
+ scale=7,
133
  placeholder="...Type something here",
134
  rtl=True,
135
  )
 
138
  chatbot=chatbot,
139
  textbox=textbox,
140
  examples=examples,
141
+ additional_inputs=additional_inputs,
142
+ cache_examples=False,
143
  )
144
 
145
  def evolve_text(x):
146
+ return "".join([x for x in generate(
147
  x, "", "<|endoftext|>",
148
  temperature=0.9, max_new_tokens=10,
149
  top_p=0.95, repetition_penalty=1.2,
150
  seed=42,
151
+ )][-1]) #TODO: need a smarter way to do this
152
 
153
  with gr.Blocks(css=CSS) as demo:
154
  with gr.Row():