Automatic Music Arrangement
Collection
4 items โข Updated
How to use LongshenOu/m2m_pt with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="LongshenOu/m2m_pt") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("LongshenOu/m2m_pt")
model = AutoModelForCausalLM.from_pretrained("LongshenOu/m2m_pt", device_map="auto")How to use LongshenOu/m2m_pt with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "LongshenOu/m2m_pt"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "LongshenOu/m2m_pt",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/LongshenOu/m2m_pt
How to use LongshenOu/m2m_pt with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "LongshenOu/m2m_pt" \
--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": "LongshenOu/m2m_pt",
"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 "LongshenOu/m2m_pt" \
--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": "LongshenOu/m2m_pt",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use LongshenOu/m2m_pt with Docker Model Runner:
docker model run hf.co/LongshenOu/m2m_pt
This model was trained from scratch on an unknown dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.7388 | 0.09 | 2000 | 0.6464 |
| 0.6096 | 0.18 | 4000 | 0.5477 |
| 0.612 | 0.27 | 6000 | 0.5144 |
| 0.53 | 0.36 | 8000 | 0.4965 |
| 0.5744 | 0.45 | 10000 | 0.4856 |
| 0.5435 | 0.54 | 12000 | 0.4776 |
| 0.5428 | 0.63 | 14000 | 0.4726 |
| 0.5065 | 0.72 | 16000 | 0.4696 |
| 0.5287 | 0.81 | 18000 | 0.4685 |
| 0.5032 | 0.9 | 20000 | 0.4682 |
| 0.5451 | 0.99 | 22000 | 0.4682 |