Views
No views yet
pip install transformers>=4.57.3pip install xlstm==2.0.41from transformers import AutoModelForCausalLM, AutoTokenizer
2device = "cuda"
3bolmo = AutoModelForCausalLM.from_pretrained("AlekseyCalvin/Lyrical_Bolmo_7b_SFT_Merged", trust_remote_code=True).to(device)
4tokenizer = AutoTokenizer.from_pretrained("AlekseyCalvin/Lyrical_Bolmo_7b_SFT_Merged", trust_remote_code=True)
5message = ["Translate the following verses: Совершить ли мне горшочек для вмещения кишочек вымещения червей красоты земли моей "]
6input_ids = tokenizer(message, return_tensors="pt")["input_ids"].to(device)
7# `max_new_tokens` is the amount of bytes to generate
8response = bolmo.generate(input_ids, max_new_tokens=256, do_sample=True, temperature=0.1)
9print(tokenizer.decode(response[0], skip_special_tokens=True))1@misc{vonwerra2022trl,
2 title = {{TRL: Transformer Reinforcement Learning}},
3 author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
4 year = 2020,
5 journal = {GitHub repository},
6 publisher = {GitHub},
7 howpublished = {\url{https://github.com/huggingface/trl}}
8}