Transformers usage error

#1
by BM-K - opened

제공해 주신 usage 실행 시 번역 작업이 수행되지 않습니다.

from transformers import AutoTokenizer, AutoModelForCausalLM

tok = AutoTokenizer.from_pretrained("trillionlabs/Tri-1.8B-Translation")
model = AutoModelForCausalLM.from_pretrained("trillionlabs/Tri-1.8B-Translation", device_map="auto")

prompt = "Translate the following Korean text into English:\n안녕하세요 <en>"
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=128)
print(tok.decode(out[0], skip_special_tokens=True))
>>> OUTPUT

Translate the following Korean text into English:
안녕하세요 <en>Hello, I am writing to you to inform you of a new development.
   ....
We are pleased to announce that we are now able to offer you the service of the most popular and most popular product in the market.
Trillion Labs org

확인해주셔서 감사합니다. README 예시가 chat template 적용이 안되어 있어 생긴 문제였던 것으로 보입니다. 해당 부분 수정했습니다.

정상 작동 확인하였습니다. 빠른 대응에 감사드립니다.

BM-K changed discussion status to closed

Sign up or log in to comment