|
|
--- |
|
|
license: llama3.1 |
|
|
language: |
|
|
- en |
|
|
- sql |
|
|
- py |
|
|
tags: |
|
|
- gis |
|
|
- geospatial |
|
|
- fine-tuned |
|
|
- unsloth |
|
|
pipeline_tag: text-generation |
|
|
--- |
|
|
|
|
|
# 🗺️ Llama-3.1-8B-GIS-Expert |
|
|
|
|
|
This model is a fine-tuned version of **Llama-3.1-8B-Instruct**, specialized for **Geospatial Analysis (GIS)**. |
|
|
|
|
|
## 🧠 Capabilities |
|
|
It has been trained on a multi-task dataset to handle three specific roles: |
|
|
1. **PostGIS Expert:** Converts natural language questions into valid `PostgreSQL` / `PostGIS` SQL queries. |
|
|
2. **Python GIS Developer:** Writes Python scripts using `geopandas`, `shapely`, and `rasterio`. |
|
|
3. **Geospatial Analyst:** Explains spatial relationships and topology logic. |
|
|
|
|
|
## 💻 How to Use |
|
|
|
|
|
### System Prompts (Crucial) |
|
|
To get the best results, you must use the correct System Prompt for the task: |
|
|
* **For SQL:** "You are a PostGIS expert. Convert the question into a SQL query." |
|
|
* **For Python:** "You are a Python GIS developer. Write a script to solve the geospatial problem." |
|
|
* **For Reasoning:** "You are a Geospatial Analyst. Explain the spatial relationship." |
|
|
|
|
|
### Example Code |
|
|
```python |
|
|
from transformers import AutoModelForCausalLM, AutoTokenizer |
|
|
|
|
|
model_id = "kumarprince070107/Llama-3.1-8B-GIS-v2" |
|
|
tokenizer = AutoTokenizer.from_pretrained(model_id) |
|
|
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto") |