Instructions to use steve-cse/MelloGPT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use steve-cse/MelloGPT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="steve-cse/MelloGPT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("steve-cse/MelloGPT") model = AutoModelForCausalLM.from_pretrained("steve-cse/MelloGPT") 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
- vLLM
How to use steve-cse/MelloGPT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "steve-cse/MelloGPT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "steve-cse/MelloGPT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/steve-cse/MelloGPT
- SGLang
How to use steve-cse/MelloGPT 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 "steve-cse/MelloGPT" \ --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": "steve-cse/MelloGPT", "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 "steve-cse/MelloGPT" \ --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": "steve-cse/MelloGPT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use steve-cse/MelloGPT with Docker Model Runner:
docker model run hf.co/steve-cse/MelloGPT
source code for fine-tuning
Hi Steve,
I hope you're doing great! I've been checking out your work and it's really interesting. I've even tried some of it myself and it worked out pretty well π.
Right now, I'm getting more into research in this area and I was hoping you could help me out. Would you be able to share any source code for fine-tuning or maybe some tutorials you have? It would really help me dive deeper.
Thanks a lot for considering my request. Looking forward to hearing from you!
Best,
Hello Radchaneeporn,
I used a tool called axolotl to streamline the fine tuning process. Check it out, https://github.com/OpenAccess-AI-Collective/axolotl
The starter guide I used was this, https://mlabonne.github.io/blog/posts/A_Beginners_Guide_to_LLM_Finetuning.html.
You can find the axolotl configuration file I wrote for mello here, https://github.com/steve-cse/mello/blob/master/mello.yml.
From my personal point of view cleaning/preparing the dataset and setting the right values during fine tuning such as epochs etc.. is more intricate and takes more time.
Hope this helps β‘
Thank you so much, I appreciate your response :D