Run this model with HF Jobs
Run eglym/DR-TEXT2SQL-CodeLlama2-7B 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/eglym/DR-TEXT2SQL-CodeLlama2-7B. 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/eglym/DR-TEXT2SQL-CodeLlama2-7B 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/eglym/DR-TEXT2SQL-CodeLlama2-7B. 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/eglym/DR-TEXT2SQL-CodeLlama2-7B. 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 eglym/DR-TEXT2SQL-CodeLlama2-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use eglym/DR-TEXT2SQL-CodeLlama2-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="eglym/DR-TEXT2SQL-CodeLlama2-7B")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("eglym/DR-TEXT2SQL-CodeLlama2-7B") model = AutoModelForCausalLM.from_pretrained("eglym/DR-TEXT2SQL-CodeLlama2-7B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use eglym/DR-TEXT2SQL-CodeLlama2-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "eglym/DR-TEXT2SQL-CodeLlama2-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "eglym/DR-TEXT2SQL-CodeLlama2-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/eglym/DR-TEXT2SQL-CodeLlama2-7B
- SGLang
How to use eglym/DR-TEXT2SQL-CodeLlama2-7B 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 "eglym/DR-TEXT2SQL-CodeLlama2-7B" \ --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": "eglym/DR-TEXT2SQL-CodeLlama2-7B", "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 "eglym/DR-TEXT2SQL-CodeLlama2-7B" \ --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": "eglym/DR-TEXT2SQL-CodeLlama2-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use eglym/DR-TEXT2SQL-CodeLlama2-7B with Docker Model Runner:
docker model run hf.co/eglym/DR-TEXT2SQL-CodeLlama2-7B
Update README.md
Browse files9 unmodified lines101112139 unmodified lineslibrary_name: transformerstags:- code---9 unmodified lines101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263649 unmodified lineslibrary_name: transformerstags:- code---# Update noticeThe model weights were updated at 3 AM UTC on Sep 12, 2024.# Model Card for DR-TEXT2SQL-CodeLlama2-7BA capable large language model for natural language to SQL generation.## Model Details### Model DescriptionThis is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.Developed by: eglymModel type: [Text to SQL]License: [CC-by-SA-4.0]Finetuned from model: [CodeLlama-7B]UsesThis model is intended to be used by non-technical users to understand data inside their SQL databases. It is meant as an analytics tool, and not as a database admin tool.This model has not been trained to reject malicious requests from users with write access to databases, and should only be used by users with read-only access.How to Get Started with the ModelUse the code here to get started with the model.PromptPlease use the following prompt for optimal results. Please remember to use do_sample=False and num_beams=4 for optimal results.### TaskGenerate a SQL query to answer [QUESTION]{user_question}[/QUESTION]### AnswerGiven the database schema, here is the SQL query that [QUESTION]{user_question}[/QUESTION][SQL]EvaluationThis model was evaluated on SQL-Eval, a PostgreSQL based evaluation framework developed by Defog for testing and alignment of model capabilities.You can read more about the methodology behind SQLEval here.ResultsWe classified each generated question into one of 6 categories. The table displays the percentage of questions answered correctly by each model, broken down by category.```basheasy medium hard extra allcount 250 440 174 170 1034compare etype exec===================== EXECUTION ACCURACY =====================exec 0.352 0.045 0.006 0.000 0.105```
README.md+52-1