Text Generation
Transformers
Safetensors
phi3
Phi-3
song
lyrics
conversational
custom_code
text-generation-inference
Instructions to use aifeifei798/Phi-3-song-lyrics-1.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aifeifei798/Phi-3-song-lyrics-1.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aifeifei798/Phi-3-song-lyrics-1.1", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("aifeifei798/Phi-3-song-lyrics-1.1", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("aifeifei798/Phi-3-song-lyrics-1.1", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aifeifei798/Phi-3-song-lyrics-1.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aifeifei798/Phi-3-song-lyrics-1.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aifeifei798/Phi-3-song-lyrics-1.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/aifeifei798/Phi-3-song-lyrics-1.1
- SGLang
How to use aifeifei798/Phi-3-song-lyrics-1.1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "aifeifei798/Phi-3-song-lyrics-1.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aifeifei798/Phi-3-song-lyrics-1.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "aifeifei798/Phi-3-song-lyrics-1.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aifeifei798/Phi-3-song-lyrics-1.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use aifeifei798/Phi-3-song-lyrics-1.1 with Docker Model Runner:
docker model run hf.co/aifeifei798/Phi-3-song-lyrics-1.1
Model Description
- This model is a specialized model, specifically designed for writing song lyrics. Phi-3 has a built-in mechanism to reduce rejection, so please use the default_lm_studio_windows in LM Studio.
- The generated lyrics may be a bit long, so please modify them yourself. If you don't modify them, I'll assume you're using the modified version, and the generated content is not related to the model :p
- lease handle the generated content yourself, as the model does not guarantee anything about - the generated content. If any copyright issues arise, please handle them yourself.
- Thanks to aifeifei799 for creating the lora
- I just integrated aifeifei799's LORA, so if you have any issues, please contact aifeifei799 :p
- The model strictly follows the MIT license.
Model Set
- download GGUF file
- set LM Studio https://lmstudio.ai/
- https://huggingface.co/aifeifei798/Phi-3-song-lyrics-1.1-Q8_0-GGUF
Model Test Prompt
"Please write song lyrics with the following structure: Intro-Verse-Chorus-Verse-Chorus-Bridge-Chorus-Outro.Rewrite an English love song in English, give me the title, complete lyrics, and style of the song, without translation or phonetic notation, with emotional and heartfelt lyrics. Here's a breakdown of each section:
song name:
Style of Music:
Intro:
Verse 1:
Chorus:
Verse 2:
Chorus:
Bridge:
Chorus:
Outro:
- Downloads last month
- 14
