Spaces:
Runtime error
Runtime error
fix: for now use another textbox
Browse files
app.py
CHANGED
|
@@ -142,16 +142,16 @@ chat_interface = gr.ChatInterface(
|
|
| 142 |
cache_examples=False,
|
| 143 |
)
|
| 144 |
|
| 145 |
-
def evolve_text(textbox
|
| 146 |
|
| 147 |
possible_generation = "".join([x for x in generate(
|
| 148 |
-
textbox
|
| 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 |
-
|
| 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 |
-
|
| 168 |
-
textbox.change(fn=evolve_text, inputs=
|
| 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()
|