Instructions to use TroyDoesAI/MermaidLlama with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TroyDoesAI/MermaidLlama with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TroyDoesAI/MermaidLlama") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TroyDoesAI/MermaidLlama") model = AutoModelForCausalLM.from_pretrained("TroyDoesAI/MermaidLlama") 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 TroyDoesAI/MermaidLlama with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TroyDoesAI/MermaidLlama" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TroyDoesAI/MermaidLlama", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TroyDoesAI/MermaidLlama
- SGLang
How to use TroyDoesAI/MermaidLlama 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 "TroyDoesAI/MermaidLlama" \ --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": "TroyDoesAI/MermaidLlama", "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 "TroyDoesAI/MermaidLlama" \ --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": "TroyDoesAI/MermaidLlama", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TroyDoesAI/MermaidLlama with Docker Model Runner:
docker model run hf.co/TroyDoesAI/MermaidLlama
Update README.md
Browse files
README.md
CHANGED
|
@@ -65,39 +65,39 @@ Exciting times ahead as we delve into the MermaidLLama revolution! 🚀
|
|
| 65 |
|
| 66 |
LoRA Rank
|
| 67 |
Also called dimension count. Higher values = larger file, more content control. Smaller values = smaller file, less control. Use 4 or 8 for style, 128 or 256 to teach, 1024+ for fine-detail on big data. More VRAM is needed for higher ranks.
|
| 68 |
-
2048
|
| 69 |
|
| 70 |
LoRA Alpha
|
| 71 |
This divided by the rank becomes the scaling of the LoRA. Higher means stronger. A good standard value is twice your Rank.
|
| 72 |
-
4096
|
| 73 |
|
| 74 |
Batch Size
|
| 75 |
Global batch size. The two batch sizes together determine gradient accumulation (gradientAccum = batch / microBatch). Higher gradient accum values lead to better quality training.
|
| 76 |
-
1
|
| 77 |
|
| 78 |
Micro Batch Size
|
| 79 |
Per-device batch size (NOTE: multiple devices not yet implemented). Increasing this will increase VRAM usage.
|
| 80 |
-
1
|
| 81 |
|
| 82 |
Cutoff Length
|
| 83 |
Cutoff length for text input. Essentially, how long of a line of text to feed in at a time. Higher values require drastically more VRAM.
|
| 84 |
-
4096
|
| 85 |
|
| 86 |
Save every n steps
|
| 87 |
If above 0, a checkpoint of the LoRA will be saved every time this many steps pass.
|
| 88 |
-
1000
|
| 89 |
|
| 90 |
Epochs
|
| 91 |
Number of times every entry in the dataset should be fed into training. So 1 means feed each item in once, 5 means feed it in five times, etc.
|
| 92 |
-
3
|
| 93 |
|
| 94 |
Learning Rate
|
| 95 |
In scientific notation.
|
| 96 |
-
1e-6
|
| 97 |
|
| 98 |
LR Scheduler
|
| 99 |
Learning rate scheduler - defines how the learning rate changes over time. "Constant" means never change, "linear" means to go in a straight line from the learning rate down to 0, cosine follows a curve, etc.
|
| 100 |
-
cosine
|
| 101 |
|
| 102 |
|
| 103 |
Target Modules
|
|
|
|
| 65 |
|
| 66 |
LoRA Rank
|
| 67 |
Also called dimension count. Higher values = larger file, more content control. Smaller values = smaller file, less control. Use 4 or 8 for style, 128 or 256 to teach, 1024+ for fine-detail on big data. More VRAM is needed for higher ranks.
|
| 68 |
+
- 2048
|
| 69 |
|
| 70 |
LoRA Alpha
|
| 71 |
This divided by the rank becomes the scaling of the LoRA. Higher means stronger. A good standard value is twice your Rank.
|
| 72 |
+
- 4096
|
| 73 |
|
| 74 |
Batch Size
|
| 75 |
Global batch size. The two batch sizes together determine gradient accumulation (gradientAccum = batch / microBatch). Higher gradient accum values lead to better quality training.
|
| 76 |
+
- 1
|
| 77 |
|
| 78 |
Micro Batch Size
|
| 79 |
Per-device batch size (NOTE: multiple devices not yet implemented). Increasing this will increase VRAM usage.
|
| 80 |
+
- 1
|
| 81 |
|
| 82 |
Cutoff Length
|
| 83 |
Cutoff length for text input. Essentially, how long of a line of text to feed in at a time. Higher values require drastically more VRAM.
|
| 84 |
+
- 4096
|
| 85 |
|
| 86 |
Save every n steps
|
| 87 |
If above 0, a checkpoint of the LoRA will be saved every time this many steps pass.
|
| 88 |
+
- 1000
|
| 89 |
|
| 90 |
Epochs
|
| 91 |
Number of times every entry in the dataset should be fed into training. So 1 means feed each item in once, 5 means feed it in five times, etc.
|
| 92 |
+
- 3
|
| 93 |
|
| 94 |
Learning Rate
|
| 95 |
In scientific notation.
|
| 96 |
+
- 1e-6
|
| 97 |
|
| 98 |
LR Scheduler
|
| 99 |
Learning rate scheduler - defines how the learning rate changes over time. "Constant" means never change, "linear" means to go in a straight line from the learning rate down to 0, cosine follows a curve, etc.
|
| 100 |
+
- cosine
|
| 101 |
|
| 102 |
|
| 103 |
Target Modules
|