Spaces:
Paused
Paused
Younes Belkada
commited on
Commit
•
7ebf2de
1
Parent(s):
aedb629
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ def inference(text, seq_length=1):
|
|
27 |
h = F.linear(h, weight=model.transformer.word_embeddings.weight) # note: this line takes a while, will also be fixed
|
28 |
next_token_ix = torch.multinomial((h[0, -1] / 0.8).softmax(-1), 1)
|
29 |
|
30 |
-
final_tokens = torch.cat([final_tokens, next_token_ix], dim=-1)
|
31 |
input_ids = next_token_ix.view(1, 1)
|
32 |
return tokenizer.decode(final_tokens, skip_special_tokens=False)
|
33 |
|
|
|
27 |
h = F.linear(h, weight=model.transformer.word_embeddings.weight) # note: this line takes a while, will also be fixed
|
28 |
next_token_ix = torch.multinomial((h[0, -1] / 0.8).softmax(-1), 1)
|
29 |
|
30 |
+
final_tokens = torch.cat([final_tokens, next_token_ix.view(1, 1)], dim=-1)
|
31 |
input_ids = next_token_ix.view(1, 1)
|
32 |
return tokenizer.decode(final_tokens, skip_special_tokens=False)
|
33 |
|