Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -273,7 +273,7 @@ def generate(model, idx, max_new_tokens, context_size, tokenizer, text_to_token_
|
|
| 273 |
# print(token_ids_to_text(idx_next, tokenizer))
|
| 274 |
# Same as before: append sampled index to the running sequence
|
| 275 |
idx = torch.cat((idx, idx_next), dim=1) # (batch_size, num_tokens+1)
|
| 276 |
-
|
| 277 |
|
| 278 |
return new_idx
|
| 279 |
|
|
@@ -529,8 +529,7 @@ thing = gr.Interface(fn=main,
|
|
| 529 |
gr.Number(label="Maximum output tokens")],
|
| 530 |
outputs=[gr.Textbox(label="Response:")],
|
| 531 |
title="CatGPT",
|
| 532 |
-
article="Meow"
|
| 533 |
-
live=True)
|
| 534 |
|
| 535 |
if __name__ == "__main__":
|
| 536 |
thing.launch()
|
|
|
|
| 273 |
# print(token_ids_to_text(idx_next, tokenizer))
|
| 274 |
# Same as before: append sampled index to the running sequence
|
| 275 |
idx = torch.cat((idx, idx_next), dim=1) # (batch_size, num_tokens+1)
|
| 276 |
+
new_idx = re.sub(".", ". Meow.", idx)
|
| 277 |
|
| 278 |
return new_idx
|
| 279 |
|
|
|
|
| 529 |
gr.Number(label="Maximum output tokens")],
|
| 530 |
outputs=[gr.Textbox(label="Response:")],
|
| 531 |
title="CatGPT",
|
| 532 |
+
article="Meow")
|
|
|
|
| 533 |
|
| 534 |
if __name__ == "__main__":
|
| 535 |
thing.launch()
|