We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
错误:RuntimeError: probability tensor contains either inf, nan or element < 0
inf
nan
代码: def init_model(): model = AutoModelForCausalLM.from_pretrained( model_path, torch_dtype=torch.float16, device_map="auto", trust_remote_code=True, )
model = PeftModel.from_pretrained(model, lora_path) model = model.merge_and_unload() model.generation_config = GenerationConfig.from_pretrained( model_path ) tokenizer = AutoTokenizer.from_pretrained( model_path, use_fast=False, trust_remote_code=True ) # tokenizer.pad_token = tokenizer.bos_token # tokenizer.padding_side = "left" return model, tokenizer
The text was updated successfully, but these errors were encountered:
No branches or pull requests
错误:RuntimeError: probability tensor contains either
inf
,nan
or element < 0代码:
def init_model():
model = AutoModelForCausalLM.from_pretrained(
model_path,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True,
)
The text was updated successfully, but these errors were encountered: