Instructions to use Houzeric/text-to-mermaid with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Houzeric/text-to-mermaid with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Houzeric/text-to-mermaid")# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("Houzeric/text-to-mermaid") model = AutoModel.from_pretrained("Houzeric/text-to-mermaid") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Houzeric/text-to-mermaid with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Houzeric/text-to-mermaid" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Houzeric/text-to-mermaid", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Houzeric/text-to-mermaid
- SGLang
How to use Houzeric/text-to-mermaid 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 "Houzeric/text-to-mermaid" \ --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": "Houzeric/text-to-mermaid", "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 "Houzeric/text-to-mermaid" \ --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": "Houzeric/text-to-mermaid", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Houzeric/text-to-mermaid with Docker Model Runner:
docker model run hf.co/Houzeric/text-to-mermaid
π§ mermaidGPT β Mermaid Diagram Generator from Natural Language
mermaidGPT is a small English-language model trained to generate valid Mermaid.js diagrams from natural language prompts. It allows users to create flowcharts, sequence diagrams, and more using simple instructions like βShow a user sending a request to a server.β Build with the dataset : Celiadraw/text-to-mermaid
π§° Features
- English-only natural language input
- Generates Mermaid.js graph code (flowcharts, sequence diagrams, etc.)
- GPT-like architecture using PyTorch
- Lightweight and fast (trainable on a single GPU)
- CLI-based usage for generation
- Can be extended with API or frontend
π¦ Project Structure
/
βββ train.py # Training script
βββ generate.py # Generate Mermaid code from prompt
βββ tokenizer.py # Tokenization utilities
βββ model.py # GPT-style model architecture
βββ data/ # Training data (if any)
βββ examples/ # Prompt examples and output
βββ checkpoints/ # Saved model checkpoints
βββ README.md
π Training
1. Build the tokenizer
python tokenizer.py
2. Train the model
python train.py
3. Hyperparameters
block_size = 128
batch_size = 32
learning_rate = 1e-3
embed_dim = 128
n_heads = 8
n_layers = 8
βοΈ Generation Example
Prompt:
Create a flowchart showing a user sending a request to a server and receiving a response.
Output:
graph TD
User -->|Request| Server
Server -->|Response| User
π License
This project is released under the MIT License. See the LICENSE file for details.
π€ Model on Hugging Face
Test or download the model on Hugging Face:
π¦ https://huggingface.co/eric-houzelle/mermaidGPT
π¬ Contact
For any suggestions or questions: eric.houzelle@email.com
- Downloads last month
- 10