AlekseyCalvin/Lyrical_Ru2En_Poems_Songs_MeterMatched_csv_SFT
Viewer • Updated • 1.79k • 27
How to use AlekseyCalvin/Lyrical_Bolmo_7b_ORPO with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="AlekseyCalvin/Lyrical_Bolmo_7b_ORPO", trust_remote_code=True) # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("AlekseyCalvin/Lyrical_Bolmo_7b_ORPO", trust_remote_code=True, dtype="auto")How to use AlekseyCalvin/Lyrical_Bolmo_7b_ORPO with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "AlekseyCalvin/Lyrical_Bolmo_7b_ORPO"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "AlekseyCalvin/Lyrical_Bolmo_7b_ORPO",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/AlekseyCalvin/Lyrical_Bolmo_7b_ORPO
How to use AlekseyCalvin/Lyrical_Bolmo_7b_ORPO with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "AlekseyCalvin/Lyrical_Bolmo_7b_ORPO" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "AlekseyCalvin/Lyrical_Bolmo_7b_ORPO",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "AlekseyCalvin/Lyrical_Bolmo_7b_ORPO" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "AlekseyCalvin/Lyrical_Bolmo_7b_ORPO",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use AlekseyCalvin/Lyrical_Bolmo_7b_ORPO with Docker Model Runner:
docker model run hf.co/AlekseyCalvin/Lyrical_Bolmo_7b_ORPO
This model is a fine-tuned version of allenai/Bolmo-7B. It has been trained using TRL.
Bolmo models have been tested with transformers 4.57.3 and Python 3.11:
pip install transformers>=4.57.3
Bolmo additionally requires the xlstm package (which needs Python>=3.11):
pip install xlstm==2.0.4
You can use this byte-level variant of the LYRICAL Poetry Translation model with the standard HuggingFace transformers library:
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda"
bolmo = AutoModelForCausalLM.from_pretrained("AlekseyCalvin/Lyrical_Bolmo_7b_SFT_Merged", trust_remote_code=True).to(device)
tokenizer = AutoTokenizer.from_pretrained("AlekseyCalvin/Lyrical_Bolmo_7b_SFT_Merged", trust_remote_code=True)
message = ["Translate the following verses: Совершить ли мне горшочек для вмещения кишочек вымещения червей красоты земли моей "]
input_ids = tokenizer(message, return_tensors="pt")["input_ids"].to(device)
# `max_new_tokens` is the amount of bytes to generate
response = bolmo.generate(input_ids, max_new_tokens=256, do_sample=True, temperature=0.1)
print(tokenizer.decode(response[0], skip_special_tokens=True))
This model was trained with SFT.
Cite TRL as:
@misc{vonwerra2022trl,
title = {{TRL: Transformer Reinforcement Learning}},
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},
year = 2020,
journal = {GitHub repository},
publisher = {GitHub},
howpublished = {\url{https://github.com/huggingface/trl}}
}