You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
"name": "IndexError",
"message": "index 51164 is out of bounds for axis 0 with size 50295",
"stack": "---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
Cell In[12], line 3
1 msg_no_e = phi2 + \"Hello, \" + with_temperature(any_char_but('e'), temperature=0.9)
2 for i in range(250):
----> 3 msg_no_e += with_temperature(any_char_but('e'), temperature=0.9)
5 msg_no_e
File ~/code/ms/guidance/guidance/models/_model.py:915, in Model.__add__(self, value)
913 # run stateless functions (grammar nodes)
914 elif isinstance(value, GrammarFunction):
--> 915 out = lm._run_stateless(value)
917 # run stateful functions
918 else:
919 out = value(lm)
File ~/code/ms/guidance/guidance/models/_model.py:1111, in Model._run_stateless(self, stateless_function, temperature, top_p, n)
1109 delayed_bytes = b\"\"
1110 # last_is_generated = False
-> 1111 for chunk in gen_obj:
1112
1113 # we make everything full probability if we are not computing uncertainty
1114 # if not self.engine.compute_log_probs:
1115 # chunk.new_bytes_prob = 1.0
1116
1117 # convert the bytes to a string (delaying if we don't yet have a valid unicode string)
1118 lm.token_count += chunk.new_token_count
1119 chunk.new_bytes = delayed_bytes + chunk.new_bytes
File ~/code/ms/guidance/guidance/models/_model.py:373, in Engine.__call__(self, parser, grammar, ensure_bos_token)
371 # loop over the tokens looking for a valid one
372 for i,sampled_token_ind in enumerate(sampling_order):
--> 373 sampled_token = self.tokenizer.tokens[sampled_token_ind]
375 # break out if we have reach impossible tokens
376 if logits[sampled_token_ind] <= -np.inf:
IndexError: index 51164 is out of bounds for axis 0 with size 50295"
}
System info (please complete the following information):
OS (e.g. Ubuntu, Windows 11, Mac OS, etc.): Mac OS, using mps device
Guidance Version (guidance.__version__): 0.1.11
The text was updated successfully, but these errors were encountered:
The bug
When generating text with phi-2, sometimes the model attempts to sample a token out of bounds of the tokenizer's token list
To Reproduce
This might take multiple attempts due to the random sampling.
Error trace:
System info (please complete the following information):
guidance.__version__
): 0.1.11The text was updated successfully, but these errors were encountered: