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

inference kwargs #35

Closed
1024er opened this issue Mar 15, 2023 · 4 comments
Closed

inference kwargs #35

1024er opened this issue Mar 15, 2023 · 4 comments

Comments

@1024er
Copy link

1024er commented Mar 15, 2023

Thanks for the great work, I reproduced the training, but at inference time tends to generate shorter text. I am using:

generated = model.generate(batch["input_ids"], max_length=512)

Does the interface on the demo web page adjust other kwargs?
Thanks

@rtaori
Copy link
Contributor

rtaori commented Mar 15, 2023

Hi, for the demo we use:

full_completion = model_current.generate(
    inputs=input_ids,
    attention_mask=attention_mask,
    temperature=0.7,
    top_p=0.9,
    do_sample=True,
    num_beams=1,
    max_new_tokens=600,
    eos_token_id=tokenizer.eos_token_id,
    pad_token_id=tokenizer.pad_token_id,
)

@puyuanOT
Copy link

Got an error:

TypeError: The current model class (LlamaModel) is not compatible with .generate(), as it doesn't have a language model head. Please use one of the following classes instead: {'LlamaForCausalLM'}

@robotagi
Copy link

Got an error:

TypeError: The current model class (LlamaModel) is not compatible with .generate(), as it doesn't have a language model head. Please use one of the following classes instead: {'LlamaForCausalLM'}

Have you solved it?

@zyg18181818
Copy link

i think you may use the wrong model type, for example you use AutoModel,but AutoModelForCausalLM is the correct choice

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

5 participants