Instructions to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model", dtype="auto") - llama-cpp-python
How to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model", filename="unsloth.Q4_K_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M # Run inference directly in the terminal: llama-cli -hf jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M # Run inference directly in the terminal: llama-cli -hf jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M
Use Docker
docker model run hf.co/jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with Ollama:
ollama run hf.co/jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M
- Unsloth Studio new
How to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model to start chatting
- Docker Model Runner
How to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with Docker Model Runner:
docker model run hf.co/jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M
- Lemonade
How to use jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model:Q4_K_M
Run and chat with the model
lemonade run user.DeepSeek-R1-Distill-Llama-4bit-sql-model-Q4_K_M
List all available models
lemonade list
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
base_model: unsloth/
|
| 3 |
tags:
|
| 4 |
- text-generation-inference
|
| 5 |
- transformers
|
|
@@ -13,7 +13,7 @@ language:
|
|
| 13 |
|
| 14 |
# About Model
|
| 15 |
|
| 16 |
-
Fine-tuning is used to convert SQL language into natural language, making it easier for users to understand the business meaning of SQL queries. This fine-tuned model is based on the unsloth framework
|
| 17 |
|
| 18 |
|
| 19 |
# DataSet
|
|
@@ -42,36 +42,58 @@ This is a complex customer analysis query used to test the understanding of the
|
|
| 42 |
query1 = """
|
| 43 |
```sql
|
| 44 |
SELECT
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
COUNT(o.
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
```
|
| 59 |
Explain use case of this query.
|
| 60 |
"""
|
| 61 |
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
Show customer id, customer name, total orders, total spent, average order value,last order date for top 10 customers by total spent.< | end▁of▁sentence|>
|
| 68 |
|
|
|
|
|
|
|
| 69 |
|
| 70 |
# Model Download
|
| 71 |
|
| 72 |
| **Model** | **Base Model** | **下载** |
|
| 73 |
| -------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 74 |
-
| DeepSeek-R1-Distill-
|
| 75 |
|
| 76 |
|
| 77 |
# Usage
|
|
@@ -81,9 +103,9 @@ If you are unsure how to use GGUF files, refer to one of [TheBloke's READMEs](ht
|
|
| 81 |
|
| 82 |
# Uploaded model
|
| 83 |
|
| 84 |
-
- **Developed by:**
|
| 85 |
- **License:** apache-2.0
|
| 86 |
-
- **Finetuned from model :** unsloth/
|
| 87 |
|
| 88 |
|
| 89 |
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: unsloth/DeepSeek-R1-Distill-Qwen-1.5B-unsloth-bnb-4bit
|
| 3 |
tags:
|
| 4 |
- text-generation-inference
|
| 5 |
- transformers
|
|
|
|
| 13 |
|
| 14 |
# About Model
|
| 15 |
|
| 16 |
+
Fine-tuning is used to convert SQL language into natural language, making it easier for users to understand the business meaning of SQL queries. This fine-tuned model is based on the unsloth framework AND uses the DeepSeek-R1-Distill-Llama-8B pre-trained model under unsloth.
|
| 17 |
|
| 18 |
|
| 19 |
# DataSet
|
|
|
|
| 42 |
query1 = """
|
| 43 |
```sql
|
| 44 |
SELECT
|
| 45 |
+
pc.category_name,
|
| 46 |
+
p.product_name,
|
| 47 |
+
COUNT(DISTINCT o.customer_id) AS unique_customers,
|
| 48 |
+
COUNT(oi.order_id) AS total_sales,
|
| 49 |
+
SUM(oi.quantity) AS total_quantity_sold,
|
| 50 |
+
ROUND(AVG(oi.unit_price), 2) AS avg_selling_price,
|
| 51 |
+
SUM(oi.quantity * oi.unit_price) AS total_revenue,
|
| 52 |
+
ROUND(SUM(oi.quantity * oi.unit_price) / COUNT(DISTINCT o.customer_id), 2) AS revenue_per_customer,
|
| 53 |
+
MAX(o.order_date) AS last_sale_date,
|
| 54 |
+
MIN(o.order_date) AS first_sale_date
|
| 55 |
+
FROM product_categories pc
|
| 56 |
+
JOIN products p ON pc.category_id = p.category_id
|
| 57 |
+
JOIN order_items oi ON p.product_id = oi.product_id
|
| 58 |
+
JOIN orders o ON oi.order_id = o.order_id
|
| 59 |
+
WHERE
|
| 60 |
+
o.order_date >= '2024-01-01'
|
| 61 |
+
AND o.order_status = 'completed'
|
| 62 |
+
GROUP BY
|
| 63 |
+
pc.category_name,
|
| 64 |
+
p.product_name
|
| 65 |
+
HAVING
|
| 66 |
+
total_revenue > 10000
|
| 67 |
+
ORDER BY
|
| 68 |
+
total_revenue DESC,
|
| 69 |
+
unique_customers DESC
|
| 70 |
+
LIMIT 15;
|
| 71 |
```
|
| 72 |
Explain use case of this query.
|
| 73 |
"""
|
| 74 |
|
| 75 |
+
<think>
|
| 76 |
+
CREATE TABLE product_categories (category_name VARCHAR, product_name VARCHAR, customer_id INT, order_id INT, order_date DATETIME, status VARCHAR)
|
| 77 |
+
FROM product_categories
|
| 78 |
+
JOIN products
|
| 79 |
+
JOIN order_items
|
| 80 |
+
JOIN orders
|
| 81 |
+
WHERE order_date >= '2024-01-01' AND order_status = 'completed'
|
| 82 |
+
GROUP BY category_name, product_name
|
| 83 |
+
HAVING total_revenue > 10000
|
| 84 |
|
| 85 |
+
This query analyzes the relationship between product categories and customer orders to identify categories and products with the highest revenue in completed orders since 2024. It can help a business understand which products are generating significant revenue and which products are performing well in the category to inform inventory planning and pricing strategies.
|
| 86 |
+
</think>
|
| 87 |
+
Below is the business use case for the query:
|
|
|
|
| 88 |
|
| 89 |
+
### Use Case:
|
| 90 |
+
This query analyzes the relationship between product categories and customer orders to identify categories and products with the highest revenue in completed orders since 2024. It can help a business understand which products are generating significant revenue in the category and which products are performing well in the category to inform inventory planning and pricing strategies.<|end▁of▁sentence|>
|
| 91 |
|
| 92 |
# Model Download
|
| 93 |
|
| 94 |
| **Model** | **Base Model** | **下载** |
|
| 95 |
| -------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| 96 |
+
| DeepSeek-R1-Distill-Qwen-1.5B-unsloth-bnb-4bit | [Qwen-1.5B](https://huggingface.co/unsloth/DeepSeek-R1-Distill-Qwen-1.5B-unsloth-bnb-4bit) | [🤗 HuggingFace](https://huggingface.co/jackcwf/DeepSeek-R1-Distill-Llama-4bit-sql-model/raw/main/unsloth.Q4_K_M.gguf) |
|
| 97 |
|
| 98 |
|
| 99 |
# Usage
|
|
|
|
| 103 |
|
| 104 |
# Uploaded model
|
| 105 |
|
| 106 |
+
- **Developed by:** datalabs-ai
|
| 107 |
- **License:** apache-2.0
|
| 108 |
+
- **Finetuned from model :** unsloth/DeepSeek-R1-Distill-Qwen-1.5B-unsloth-bnb-4bit
|
| 109 |
|
| 110 |
|
| 111 |
|