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

fix predict #264

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion evalscope/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ def from_json(json_file: str):
def from_args(args: Namespace):
# Convert Namespace to a dictionary and filter out None values
args_dict = {k: v for k, v in vars(args).items() if v is not None}
del args_dict['func'] # Note: compat CLI arguments

if 'func' in args_dict:
del args_dict['func'] # Note: compat CLI arguments

return TaskConfig.from_dict(args_dict)

Expand Down
2 changes: 1 addition & 1 deletion evalscope/models/model_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ def _model_generate(self, query: str, infer_cfg: dict) -> str:
fix_do_sample_warning(self.generation_config)

# Run inference
output_ids = self.model.generate(**inputs, generation_config=self.generation_config)
output_ids = self.model.generate(input_ids, generation_config=self.generation_config)

response = self.tokenizer.decode(output_ids[0, len(input_ids[0]):], skip_special_tokens=True)
return response
Expand Down
Loading