Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -53,7 +53,7 @@ def infer(
|
|
53 |
occurrence = {}
|
54 |
state = None
|
55 |
for i in range(int(token_count)):
|
56 |
-
out, state = model.forward(pipeline.encode(ctx)[:
|
57 |
for n in args.token_ban:
|
58 |
out[n] = -float('inf')
|
59 |
for n in occurrence:
|
|
|
53 |
occurrence = {}
|
54 |
state = None
|
55 |
for i in range(int(token_count)):
|
56 |
+
out, state = model.forward(pipeline.encode(ctx)[-ctx_limit:] if i == 0 else [token], state)
|
57 |
for n in args.token_ban:
|
58 |
out[n] = -float('inf')
|
59 |
for n in occurrence:
|