Instructions to use sriram882004/SQL-Socratic-Models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use sriram882004/SQL-Socratic-Models with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="sriram882004/SQL-Socratic-Models", filename="gemma2/gemma2_9b__fft__base__masked/gguf/gemma2_9b__fft__base__masked_q8_0.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use sriram882004/SQL-Socratic-Models with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf sriram882004/SQL-Socratic-Models:Q8_0 # Run inference directly in the terminal: llama cli -hf sriram882004/SQL-Socratic-Models:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf sriram882004/SQL-Socratic-Models:Q8_0 # Run inference directly in the terminal: llama cli -hf sriram882004/SQL-Socratic-Models:Q8_0
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 sriram882004/SQL-Socratic-Models:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf sriram882004/SQL-Socratic-Models:Q8_0
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 sriram882004/SQL-Socratic-Models:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf sriram882004/SQL-Socratic-Models:Q8_0
Use Docker
docker model run hf.co/sriram882004/SQL-Socratic-Models:Q8_0
- LM Studio
- Jan
- Ollama
How to use sriram882004/SQL-Socratic-Models with Ollama:
ollama run hf.co/sriram882004/SQL-Socratic-Models:Q8_0
- Unsloth Studio
How to use sriram882004/SQL-Socratic-Models 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 sriram882004/SQL-Socratic-Models 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 sriram882004/SQL-Socratic-Models to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for sriram882004/SQL-Socratic-Models to start chatting
- Atomic Chat new
- Docker Model Runner
How to use sriram882004/SQL-Socratic-Models with Docker Model Runner:
docker model run hf.co/sriram882004/SQL-Socratic-Models:Q8_0
- Lemonade
How to use sriram882004/SQL-Socratic-Models with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull sriram882004/SQL-Socratic-Models:Q8_0
Run and chat with the model
lemonade run user.SQL-Socratic-Models-Q8_0
List all available models
lemonade list
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,26 +1,64 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
---
|
|
|
|
| 4 |
# SQL Socratic Models
|
| 5 |
|
| 6 |
-
This repository contains fine-tuned
|
| 7 |
|
| 8 |
## Models
|
| 9 |
- phi3_rq4
|
| 10 |
- qwen25
|
| 11 |
-
-
|
| 12 |
|
| 13 |
## Method
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
## Contributions
|
| 17 |
-
- Fine-tuning across multiple architectures
|
| 18 |
-
-
|
| 19 |
-
- Evaluation on
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
## Usage
|
| 22 |
```python
|
| 23 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 24 |
|
| 25 |
model = AutoModelForCausalLM.from_pretrained("sriram882004/SQL-Socratic-Models/phi3_rq4")
|
| 26 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
---
|
| 4 |
+
|
| 5 |
# SQL Socratic Models
|
| 6 |
|
| 7 |
+
This repository contains fine-tuned large language models for **Socratic SQL instruction** in higher education, focusing on guiding learners through SQL concepts using structured reasoning rather than providing direct solutions.
|
| 8 |
|
| 9 |
## Models
|
| 10 |
- phi3_rq4
|
| 11 |
- qwen25
|
| 12 |
+
- gemma2
|
| 13 |
|
| 14 |
## Method
|
| 15 |
+
|
| 16 |
+
Our approach is designed to support **conceptual learning in STEM education** through Socratic interaction:
|
| 17 |
+
|
| 18 |
+
- **Phase 1 (Data Construction):**
|
| 19 |
+
SQL instruction data is augmented with Socratic prompts emphasizing:
|
| 20 |
+
- Question decomposition
|
| 21 |
+
- Conceptual hints
|
| 22 |
+
- Guided reasoning steps
|
| 23 |
+
|
| 24 |
+
- **Phase 2 (Fine-Tuning):**
|
| 25 |
+
We apply full fine-tuning (FFT) on small, open-source LLMs with **pedagogical constraints** that explicitly discourage direct answer generation and instead promote:
|
| 26 |
+
- Conceptual scaffolding
|
| 27 |
+
- Incremental reasoning
|
| 28 |
+
- Learner-centered guidance
|
| 29 |
+
|
| 30 |
+
- **Phase 3 (Evaluation):**
|
| 31 |
+
Models are evaluated using:
|
| 32 |
+
- **BERTScore** for semantic alignment with expected reasoning
|
| 33 |
+
- **ROUGE-L** to measure and control **answer leakage** (i.e., avoidance of direct SQL solutions)
|
| 34 |
|
| 35 |
## Contributions
|
| 36 |
+
- Fine-tuning across multiple architectures (Phi-3, Qwen2.5, Gemma2) for **instructional SQL reasoning**
|
| 37 |
+
- Development of **Socratic SQL prompting framework** for higher education contexts
|
| 38 |
+
- Evaluation of models on their ability to generate **guidance without revealing final answers**
|
| 39 |
+
- Ablation study identifying factors that enable LLMs to mimic effective instructors through:
|
| 40 |
+
- Misconception-aware feedback
|
| 41 |
+
- Iterative questioning
|
| 42 |
+
- Structured reasoning support
|
| 43 |
+
|
| 44 |
+
## Task
|
| 45 |
+
|
| 46 |
+
Given a natural language SQL question, the model generates:
|
| 47 |
+
|
| 48 |
+
1. Socratic reasoning steps
|
| 49 |
+
2. Conceptual hints and guiding questions
|
| 50 |
+
3. Intermediate decomposition of the problem
|
| 51 |
+
|
| 52 |
+
**The model does NOT produce the final SQL query**, ensuring alignment with instructional use in higher education settings.
|
| 53 |
+
|
| 54 |
+
This design supports:
|
| 55 |
+
- Active learning
|
| 56 |
+
- Conceptual understanding of SQL
|
| 57 |
+
- Integration of database concepts into broader STEM curricula
|
| 58 |
|
| 59 |
## Usage
|
| 60 |
```python
|
| 61 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 62 |
|
| 63 |
model = AutoModelForCausalLM.from_pretrained("sriram882004/SQL-Socratic-Models/phi3_rq4")
|
| 64 |
+
tokenizer = AutoTokenizer.from_pretrained("sriram882004/SQL-Socratic-Models/phi3_rq4")
|