Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'max_tokens' #7

Open
MubasharSaeedPhD opened this issue Feb 21, 2024 · 0 comments
Open

KeyError: 'max_tokens' #7

MubasharSaeedPhD opened this issue Feb 21, 2024 · 0 comments

Comments

@MubasharSaeedPhD
Copy link

KeyError Traceback (most recent call last)
in <cell line: 13>()
14 best_overall_score = -np.inf
15 # query Planning LM for single-step action candidates
---> 16 samples, log_probs = generator(curr_prompt + f'\nStep {step}:', sampling_params)
17 for sample, log_prob in zip(samples, log_probs):
18 most_similar_idx, matching_score = find_most_similar(sample, action_list_embedding)

in _generate(prompt, sampling_params)
15 input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(device)
16 prompt_len = input_ids.shape[-1]
---> 17 output_dict = model.generate(input_ids, max_length=prompt_len + sampling_params['max_tokens'], **sampling_params) # Update parameter name
18 # discard the prompt (only take the generated text)
19 generated_samples = tokenizer.batch_decode(output_dict.sequences[:, prompt_len:])

KeyError: 'max_tokens'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant