Run this model with HF Jobs
Run mlx-community/defog-sqlcoder-7b-2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/mlx-community/defog-sqlcoder-7b-2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/mlx-community/defog-sqlcoder-7b-2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/mlx-community/defog-sqlcoder-7b-2. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/mlx-community/defog-sqlcoder-7b-2. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use mlx-community/defog-sqlcoder-7b-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mlx-community/defog-sqlcoder-7b-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mlx-community/defog-sqlcoder-7b-2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mlx-community/defog-sqlcoder-7b-2") model = AutoModelForCausalLM.from_pretrained("mlx-community/defog-sqlcoder-7b-2", device_map="auto") - MLX
How to use mlx-community/defog-sqlcoder-7b-2 with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/defog-sqlcoder-7b-2") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- vLLM
How to use mlx-community/defog-sqlcoder-7b-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mlx-community/defog-sqlcoder-7b-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/defog-sqlcoder-7b-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mlx-community/defog-sqlcoder-7b-2
- SGLang
How to use mlx-community/defog-sqlcoder-7b-2 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 "mlx-community/defog-sqlcoder-7b-2" \ --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": "mlx-community/defog-sqlcoder-7b-2", "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 "mlx-community/defog-sqlcoder-7b-2" \ --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": "mlx-community/defog-sqlcoder-7b-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - MLX LM
How to use mlx-community/defog-sqlcoder-7b-2 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "mlx-community/defog-sqlcoder-7b-2" --prompt "Once upon a time"
- Docker Model Runner
How to use mlx-community/defog-sqlcoder-7b-2 with Docker Model Runner:
docker model run hf.co/mlx-community/defog-sqlcoder-7b-2
- Atomic Chat
Upload folder using huggingface_hub
Browse filesFiles changed (4)
18 unmodified lines1920212223242550 unmodified lines7677787980818218 unmodified lines"output_hidden_states": false,"output_attentions": false,"torchscript": false,"torch_dtype": "bfloat16","use_bfloat16": false,"tf_legacy_loss": false,"pruned_heads": {},50 unmodified lines"decoder_start_token_id": null,"task_specific_params": null,"problem_type": null,"_name_or_path": "/Users/gmcjy/.cache/huggingface/hub/models--defog--sqlcoder-7b-2/snapshots/09f5dfc1d1338bd44824d6d0a7a69682f9b4c977","transformers_version": "4.37.2","model_type": "llama"}18 unmodified lines1920212223242550 unmodified lines7677787980818218 unmodified lines"output_hidden_states": false,"output_attentions": false,"torchscript": false,"torch_dtype": "float16","use_bfloat16": false,"tf_legacy_loss": false,"pruned_heads": {},50 unmodified lines"decoder_start_token_id": null,"task_specific_params": null,"problem_type": null,"_name_or_path": "/Users/gmcjy/.cache/huggingface/hub/models--defog--sqlcoder-7b-2/snapshots/b645fe3146087c7aedea712a900e208b3a3f0152","transformers_version": "4.37.2","model_type": "llama"}
123version https://git-lfs.github.com/spec/v1oid sha256:fb9f8bd342521ca9fe90f76770f27c9a6131cf0298f0883466d6a93337ac3389size 5343884067123version https://git-lfs.github.com/spec/v1oid sha256:5d5d078854b0b42be409d3aabc6ac74e49ff0bc1162574b9f47858897c671418size 5343884067
123version https://git-lfs.github.com/spec/v1oid sha256:829b3e26e0b3438c7134c1bc9f21ccedf434a74b3a1866af9b9818da8412dd6csize 5352158545123version https://git-lfs.github.com/spec/v1oid sha256:b5affecc3ce18b9ed9a04cfb4bf2d9c25241b59ecc015d6210d00d42b8cad789size 5352158545
123version https://git-lfs.github.com/spec/v1oid sha256:de26c11198a59ab7babaa95d426e54e6ad9c920c50c2f4d24129ede4273884ebsize 2781084263123version https://git-lfs.github.com/spec/v1oid sha256:017e68dc701004cc4a95ed5cfdedf04e4b5e97e1103c34c6612e2419df78b640size 2781084263
config.json+2-2
model-00001-of-00003.safetensors+1-1
model-00002-of-00003.safetensors+1-1
model-00003-of-00003.safetensors+1-1