Skip to content

【inference】support load or save Llama2-7b in three patterns #8766

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

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Changes from 1 commit
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
7 changes: 2 additions & 5 deletions llm/predict/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,8 @@ class StaticGraphPredictor(BasePredictor):
def __init__(self, config: PredictorArgument, tokenizer: PretrainedTokenizer = None):
super().__init__(config, tokenizer)

params_path = os.path.join(self.config.model_name_or_path, self.config.model_prefix + ".pdiparams")
if paddle.framework.use_pir_api():
model_path = os.path.join(self.config.model_name_or_path, self.config.model_prefix + ".json")
else:
model_path = os.path.join(self.config.model_name_or_path, self.config.model_prefix + ".pdmodel")
params_path = self.config.model_prefix
model_path = self.config.model_name_or_path
inference_config = paddle.inference.Config(model_path, params_path)
Copy link
Collaborator

@yuanlehome yuanlehome Jul 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inference_config = paddle.inference.Config(self.config.model_name_or_path, self.config.model_prefix)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些改成这一行就行了


if self.config.device == "gpu":
Expand Down
Loading