Update README.md
Browse files
README.md
CHANGED
@@ -1,22 +1,56 @@
|
|
1 |
---
|
2 |
base_model: unsloth/Llama-3.2-3B-Instruct
|
3 |
tags:
|
4 |
-
- text-generation
|
|
|
|
|
5 |
- transformers
|
6 |
- unsloth
|
7 |
- llama
|
8 |
- trl
|
|
|
|
|
9 |
license: apache-2.0
|
10 |
language:
|
11 |
- en
|
|
|
|
|
|
|
|
|
12 |
---
|
13 |
|
14 |
-
#
|
15 |
|
16 |
-
- **Developed by:** skshmjn
|
17 |
-
- **License:** apache-2.0
|
18 |
-
- **Finetuned from model
|
|
|
|
|
19 |
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
base_model: unsloth/Llama-3.2-3B-Instruct
|
3 |
tags:
|
4 |
+
- text-generation
|
5 |
+
- mongodb
|
6 |
+
- query-generation
|
7 |
- transformers
|
8 |
- unsloth
|
9 |
- llama
|
10 |
- trl
|
11 |
+
- gguf
|
12 |
+
- quantized
|
13 |
license: apache-2.0
|
14 |
language:
|
15 |
- en
|
16 |
+
datasets:
|
17 |
+
- skshmjn/mongo_prompt_query
|
18 |
+
pipeline_tag: text-generation
|
19 |
+
library_name: transformers
|
20 |
---
|
21 |
|
22 |
+
# MongoDB Query Generator - Llama-3.2-3B (Fine-tuned)
|
23 |
|
24 |
+
- **Developed by:** skshmjn
|
25 |
+
- **License:** apache-2.0
|
26 |
+
- **Finetuned from model:** [unsloth/Llama-3.2-3B-Instruct](https://huggingface.co/unsloth/Llama-3.2-3B-Instruct)
|
27 |
+
- **Dataset Used:** [skshmjn/mongodb-chat-query](https://huggingface.co/datasets/skshmjn/mongodb-chat-query)
|
28 |
+
- **Supports:** Transformers & GGUF (for fast inference on CPU/GPU)
|
29 |
|
30 |
+
## 🚀 **Model Overview**
|
31 |
+
This model is designed to **generate MongoDB queries** from natural language prompts. It supports:
|
32 |
+
- **Basic CRUD operations:** `find`, `insert`, `update`, `delete`
|
33 |
+
- **Aggregation Pipelines:** `$group`, `$match`, `$lookup`, `$sort`, etc.
|
34 |
+
- **Indexing & Performance Queries**
|
35 |
+
- **Nested Queries & Joins (`$lookup`)**
|
36 |
|
37 |
+
Trained using **Unsloth** for efficient fine-tuning and **GGUF quantization** for fast inference.
|
38 |
+
|
39 |
+
---
|
40 |
+
|
41 |
+
## 📌 **Example Usage (Transformers)**
|
42 |
+
```python
|
43 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
44 |
+
|
45 |
+
model_name = "skshmjn/Llama-3.2-3B-Mongo-Instruct"
|
46 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
47 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
48 |
+
schema = {} // Pass your mongodb schema here or leave empty for generic queries
|
49 |
+
|
50 |
+
prompt = "Here is mongodb schema {schema} and Find all employees older than 30 in the 'employees' collection."
|
51 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
52 |
+
|
53 |
+
output = model.generate(**inputs, max_length=100)
|
54 |
+
query = tokenizer.decode(output[0], skip_special_tokens=True)
|
55 |
+
|
56 |
+
print(query)
|