You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am trying to do some basic inference with your sft and policy models.
However, when I instanciate the model directly with LlamaForCausalLM, the generation works well for the base pretrained LLama. But the sft model outputs nothing and the policy model outputs random tokens.
Could you help me with that? :) Thanks in advance!
from transformers import AutoTokenizer, LlamaForCausalLM
# base Llama 1
model_name_or_path1 = 'baffo32/decapoda-research-llama-7B-hf'
tokenizer_name_or_path = '/nas/ucb/henrypapadatos/MOSS-RLHF/models/moss-rlhf-policy-model-7B-en'
model1 = LlamaForCausalLM.from_pretrained(model_name_or_path1,device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(tokenizer_name_or_path, padding_side='left')
prompt = "Hey, are you conscious? Can you talk to me?"
inputs = tokenizer(prompt, return_tensors="pt").to(device=cuda)
generate_ids = model1.generate(inputs.input_ids, max_length=50)
output = tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
print(output)
Output:
Hey, are you conscious? Can you talk to me?
I'm not sure if you're conscious, but I'm going to assume you are.
I'm not sure if you're conscious, but I'
Output:
Hey, are you conscious? Can you talk to me?lapsedmodниципамина� deploymentclassesандфикаouses compat thereforezzachn乡 Hope WilliamHER forms problemunicí filmewissenschaft scopeASHERTстыunderline instrumentsполиAnalItalie essentialRegisterкраї traverse автор
The text was updated successfully, but these errors were encountered:
Hello,
I am trying to do some basic inference with your sft and policy models.
However, when I instanciate the model directly with LlamaForCausalLM, the generation works well for the base pretrained LLama. But the sft model outputs nothing and the policy model outputs random tokens.
Could you help me with that? :) Thanks in advance!
Output:
Hey, are you conscious? Can you talk to me?
I'm not sure if you're conscious, but I'm going to assume you are.
I'm not sure if you're conscious, but I'
Output:
Hey, are you conscious? Can you talk to me?
Output:
Hey, are you conscious? Can you talk to me?lapsedmodниципамина� deploymentclassesандфикаouses compat thereforezzachn乡 Hope WilliamHER forms problemunicí filmewissenschaft scopeASHERTстыunderline instrumentsполиAnalItalie essentialRegisterкраї traverse автор
The text was updated successfully, but these errors were encountered: