Hi - In the Translate function… dont we need to pass a different next_token each time ?
Iterate for max_length iterations
for _ in range(max_length):
# Generate the next token
try:
next_token, logit, state, done = generate_next_token(
decoder=model.decoder,
context=context,
next_token=next_token,
done=done,
state=state,
temperature=temperature
)
except:
raise Exception("Problem generating the next token")
Unit test results
Failed test case: translate didn’t return the same logit when using temperature of 0.0.
Expected: -0.6533634066581726
Got: -0.5493094921112