Can someone explain why this error #1702
Unanswered
wickedWOLF123
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Agent
agent_prompt = agent_prompt_template.format(question=question)
print("Agent Prompt:\n", agent_prompt)
Generate the teacher's guidance using the base model.
inputs = tokenizer(agent_prompt, return_tensors="pt", padding="max_length", truncation=True, max_length=512)
inputs = {key: value.to(model.device) for key, value in inputs.items()}
print(inputs)
agent_output = model.generate(**inputs, max_new_tokens=20)
decoded_agent = tokenizer.decode(agent_output[0], skip_special_tokens=True)
print("\nAgent Output (Teacher's Guidance):\n", decoded_agent)
{'input_ids': tensor([[128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004, 128004,
128004, 128000, 2675, 1288, 1180, 439, 264, 8641, 627,
2675, 690, 1464, 1523, 279, 1920, 1139, 3927, 11,
49839, 19351, 3094, 14656, 30308, 11, 1855, 6522, 74145,
311, 279, 1620, 1121, 627, 40, 690, 1833, 701,
19351, 555, 38714, 279, 4320, 311, 1855, 3094, 449,
39006, 382, 7927, 2077, 2011, 3449, 279, 2768, 8670,
512, 16, 8, 3234, 539, 2997, 904, 29217, 304,
701, 11470, 430, 374, 279, 5575, 2683, 627, 17,
8, 1442, 279, 1510, 7033, 3575, 374, 5644, 311,
387, 29056, 555, 2768, 701, 1828, 19351, 11, 1212,
433, 449, 1054, 7184, 499, 649, 4320, 198, 1820,
3575, 304, 420, 3094, 2029, 627, 18, 8, 1442,
279, 1620, 4320, 311, 279, 1510, 7033, 3575, 706,
1027, 12457, 11, 1120, 2019, 1054, 791, 7033, 3575,
706, 1027, 29056, 2950, 8991, 22854, 1473, 220, 56111,
374, 14324, 3300, 369, 264, 502, 15435, 902, 7194,
400, 1041, 13, 720, 220, 56111, 706, 1193, 4376,
315, 279, 3300, 1364, 3966, 13, 720, 220, 6385,
6699, 6773, 311, 3041, 1077, 400, 868, 369, 430,
7580, 11, 323, 1077, 56435, 11157, 439, 1790, 439,
1077, 6699, 13, 720, 220, 2650, 1790, 810, 3300,
1587, 56111, 1205, 311, 3780, 279, 15435, 1980]],
device='cuda:0'), 'attention_mask': tensor([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1]], device='cuda:0')}
RuntimeError Traceback (most recent call last)
in <cell line: 0>()
51 print(inputs)
52
---> 53 agent_output = model.generate(**inputs, max_new_tokens=20)
54 decoded_agent = tokenizer.decode(agent_output[0], skip_special_tokens=True)
55 print("\nAgent Output (Teacher's Guidance):\n", decoded_agent)
4 frames
/usr/local/lib/python3.11/dist-packages/torch/utils/_contextlib.py in decorate_context(*args, **kwargs)
113 def decorate_context(*args, **kwargs):
114 with ctx_factory():
--> 115 return func(*args, **kwargs)
116
117 return decorate_context
/usr/local/lib/python3.11/dist-packages/unsloth/models/llama.py in _fast_generate(*args, **kwargs)
1571 # Autocasted
1572 with torch.autocast(device_type = device_type, dtype = dtype):
-> 1573 output = generate(*args, **kwargs)
1574 pass
1575
/usr/local/lib/python3.11/dist-packages/torch/utils/_contextlib.py in decorate_context(*args, **kwargs)
113 def decorate_context(*args, **kwargs):
114 with ctx_factory():
--> 115 return func(*args, **kwargs)
116
117 return decorate_context
/usr/local/lib/python3.11/dist-packages/transformers/generation/utils.py in generate(self, inputs, generation_config, logits_processor, stopping_criteria, prefix_allowed_tokens_fn, synced_gpus, assistant_model, streamer, negative_prompt_ids, negative_prompt_attention_mask, **kwargs)
2221
2222 # 12. run sample (it degenerates to greedy search when
generation_config.do_sample=False
)-> 2223 result = self._sample(
2224 input_ids,
2225 logits_processor=prepared_logits_processor,
/usr/local/lib/python3.11/dist-packages/transformers/generation/utils.py in _sample(self, input_ids, logits_processor, stopping_criteria, generation_config, synced_gpus, streamer, **model_kwargs)
3255 probs = nn.functional.softmax(next_token_scores, dim=-1)
3256 # TODO (joao): this OP throws "skipping cudagraphs due to ['incompatible ops']", find solution
-> 3257 next_tokens = torch.multinomial(probs, num_samples=1).squeeze(1)
3258 else:
3259 next_tokens = torch.argmax(next_token_scores, dim=-1)
RuntimeError: probability tensor contains either
inf
,nan
or element < 0It seemed to be working yesterday and stopped today?
Beta Was this translation helpful? Give feedback.
All reactions