Downloads · 30 days
14
12% of all-time downloads
prabhugururaj88/gemma2-mql-v2-q4
gemma2-mql-v2-q4 is a text generation model from prabhugururaj88. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
A fine-tuned Gemma 2 2B-IT model that converts natural language questions into MongoDB queries (MQL) for the AIDP EntityViews collection.
Downloads · 30 days
14
12% of all-time downloads
All-time downloads
113
Public
Repo size
1.7 GB
Likes
0
Public
Click a slice to open those files.
.gguf1.7 GB · 100%
From the Hugging Face model README
A fine-tuned Gemma 2 2B-IT model that converts natural language questions into MongoDB queries (MQL) for the AIDP EntityViews collection.
| File | Format | Size | Description |
|---|---|---|---|
gemma2-mql-v2-Q4_K_M.gguf | GGUF Q4_K_M | 1.6 GB | Recommended - best size/quality balance |
gemma2-mql-v2-f16.gguf | GGUF F16 | 4.9 GB | Full precision |
The model generates MQL queries for the EntityViews collection with these fields:
name - file path/nameextension - file extension (txt, tiff, exr, usd, jpg, png)format - file formatsize - file size in bytestype / entity_type - entity typehas_pii - whether file contains PIIprocessed - processing statuscreate_time / modified_time / access_time - timestampspermissions - Unix permissions (e.g., rw-r--r--)content_attributes - extracted content metadata including image descriptionschange_type - ADDED, MODIFIED, etc.errors - processing errorscustom_attributes - custom metadata# Download the GGUF file, then create a Modelfile:
cat > Modelfile << 'EOF'
FROM ./gemma2-mql-v2-Q4_K_M.gguf
TEMPLATE """{{ if .System }}<start_of_turn>system
{{ .System }}<end_of_turn>
{{ end }}{{ if .Prompt }}<start_of_turn>user
{{ .Prompt }}<end_of_turn>
{{ end }}<start_of_turn>model
{{ .Response }}<end_of_turn>
"""
SYSTEM """You are a MongoDB query generator. Given a natural language question about files in the EntityViews collection, generate the correct MongoDB query (MQL) as JSON. Always use $regex with case-insensitive matching for name searches unless an exact path is provided."""
PARAMETER temperature 0.1
PARAMETER top_p 0.9
PARAMETER stop "<end_of_turn>"
EOF
ollama create gemma2-mql -f Modelfile
ollama run gemma2-mql "Find all tiff files larger than 10MB"
# For the F16 safetensors version, use the base fine-tuned model directly:
pip install vllm
python -m vllm.entrypoints.openai.api_server \
--model <your-hf-username>/gemma2-mql-v2 \
--dtype bfloat16 \
--max-model-len 4096 \
--gpu-memory-utilization 0.9
| Input | Generated MQL |
|---|---|
| "Find all tiff files larger than 10MB" | {"$and": [{"extension": "tiff"}, {"size": {"$gt": 10485760}}]} |
| "Show files with PII" | {"has_pii": true} |
| "Find the file water-droplet" | {"name": {"$regex": ".*water-droplet.*", "$options": "i"}} |
| "How many exr files are there" | {"collection": "EntityViews", "method": "count", "filter": {"extension": "exr"}} |
| "Show me top 5 files by sizes" | {"collection": "EntityViews", "method": "find", "filter": {}, "sort": {"size": -1}, "limit": 5} |
| "What images show the Golden Gate Bridge" | {"content_attributes": {"$elemMatch": {"key": "Image Description", "value": {"$regex": ".*Golden Gate Bridge.*", "$options": "i"}}}} |
Fine-tuned on 1,164 samples covering: