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
An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
My own task or dataset (give details below)
Reproduction
fromtransformersimportAutoModelForCausalLM, AutoTokenizerautoawq_model="casperhansen/opt-125m-awq"prompt="One day, the little girl"user_model=AutoModelForCausalLM.from_pretrained(autoawq_model).to('cuda:0')
tokenizer=AutoTokenizer.from_pretrained(autoawq_model)
input_ids=tokenizer(prompt, return_tensors="pt")["input_ids"].to('cuda:0')
generate_kwargs=dict(do_sample=False, temperature=0.9, num_beams=4)
gen_ids=user_model.generate(input_ids, **generate_kwargs)
gen_text=tokenizer.batch_decode(gen_ids, skip_special_tokens=True)
target_text= ["One day, the little girl in the back of my mind will ask me if I'm a"]
assertgen_text==target_text, f"Expect: {target_text}\n but get: {gen_text}."
Expected behavior
When version < 4.47.0, it works well. Version 4.47.0 provides different result
Traceback (most recent call last):
File "/data6/xinhe/fx_test/test.py", line 13, in <module>
assert gen_text == target_text, f"Expect: {target_text}\n but get: {gen_text}."
AssertionError: Expect: ["One day, the little girl in the back of my mind will ask me if I'm a"]
but get: ['One day, the little girl in the back of my mind will say, ??I??m so glad you??'].
The text was updated successfully, but these errors were encountered:
System Info
transformers
version: 4.47.0Who can help?
@gante @SunMarc @MekkCyber
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Expected behavior
When version < 4.47.0, it works well. Version 4.47.0 provides different result
The text was updated successfully, but these errors were encountered: