Instructions to use TristanBehrens/js-fakes-4bars with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TristanBehrens/js-fakes-4bars with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TristanBehrens/js-fakes-4bars")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TristanBehrens/js-fakes-4bars") model = AutoModelForCausalLM.from_pretrained("TristanBehrens/js-fakes-4bars") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use TristanBehrens/js-fakes-4bars with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TristanBehrens/js-fakes-4bars" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TristanBehrens/js-fakes-4bars", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TristanBehrens/js-fakes-4bars
- SGLang
How to use TristanBehrens/js-fakes-4bars 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 "TristanBehrens/js-fakes-4bars" \ --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": "TristanBehrens/js-fakes-4bars", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "TristanBehrens/js-fakes-4bars" \ --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": "TristanBehrens/js-fakes-4bars", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TristanBehrens/js-fakes-4bars with Docker Model Runner:
docker model run hf.co/TristanBehrens/js-fakes-4bars
GPT-2 for Music
Language Models such as GPT-2 can be used for Music Generation. The idea is to represent pieces of music as texts, effectively reducing the task to Language Generation.
This model is a rather small instance of GPT-2 trained on TristanBehrens/js-fakes-4bars. The model generates 4 bars at a time of Bach-like chorales with four voices (soprano, alto, tenor, bass).
If you are contribute, if you want to say hello, if you want to know more, find me on LinkedIn
Model description
The model is GPT-2 with 6 decoders and 8 attention-heads each. The context length is 512. The embedding dimensions are 512 as well. The vocabulary size is 119.
Intended uses & limitations
This model is just a proof of concept. It shows that HuggingFace can be used to compose music.
How to use
There is a notebook in the repo that you can run on Google Colab.
Limitations and bias
Since this model has been trained on a very small corpus of music, it is overfitting heavily.
- Downloads last month
- 1,388