Update README.md
Browse files
README.md
CHANGED
|
@@ -1,97 +1,109 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
<
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
| 41 |
-
|
| 42 |
-
|
|
| 43 |
-
|
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- lucasmccabe/logiqa
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
base_model:
|
| 8 |
+
- microsoft/Phi-3-mini-4k-instruct
|
| 9 |
+
tags:
|
| 10 |
+
- code
|
| 11 |
+
- logic
|
| 12 |
+
- efficiency
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
<h1 align="center">Circuit</h1>
|
| 16 |
+
<p align="center">Fine-tuned Phi-3 for Logical Reasoning</p>
|
| 17 |
+
|
| 18 |
+
<p align="center">
|
| 19 |
+
<img src="https://i.postimg.cc/Nfnst2F9/Circuit.png" alt="Circuit Logo" style="max-width:100%; height:auto;">
|
| 20 |
+
</p>
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
# Model performance
|
| 24 |
+
|
| 25 |
+
## Benchmark
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
<p align="center">
|
| 29 |
+
<img src="https://i.postimg.cc/85pjRhwf/daata.png" alt="App Screenshot" style="max-width:100%; height:auto;">
|
| 30 |
+
</p>
|
| 31 |
+
|
| 32 |
+
Trained on the [lucasmccabe/logiqa](https://huggingface.co/datasets/lucasmccabe/logiqa) dataset, Circuit enhances the model’s ability to reason through complex problems, answer multi-step logic questions, and provide consistent explanations.
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
# Model Details
|
| 36 |
+
|
| 37 |
+
| Property | Value |
|
| 38 |
+
|-----------|--------|
|
| 39 |
+
| **Base model** | `microsoft/Phi-3-mini-4k-instruct` |
|
| 40 |
+
| **Fine-tuned for** | Logical Reasoning |
|
| 41 |
+
| **Dataset** | [`lucasmccabe/logiqa`](https://huggingface.co/datasets/lucasmccabe/logiqa) |
|
| 42 |
+
| **Technique** | LoRA fine-tuning, merged for direct use |
|
| 43 |
+
| **Formats available** | Full (HF Transformers) + Quantized (`.gguf` for llama.cpp / Ollama) |
|
| 44 |
+
| **Project** | **Circuit** |
|
| 45 |
+
| **Fine-tuned by** | Rudransh |
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
# Model Variants
|
| 52 |
+
|
| 53 |
+
| Variant | Description | File |
|
| 54 |
+
|----------|--------------|------|
|
| 55 |
+
| **Full model** | Merged LoRA with base, compatible with `transformers` | `pytorch_model.bin` |
|
| 56 |
+
| **Quantized model (GGUF)** | Optimized for CPU/GPU inference via `llama.cpp`, `text-generation-webui`, or `Ollama` | `circuit_phi3_q4.gguf` |
|
| 57 |
+
|
| 58 |
+
# Example Usage (Transformers)
|
| 59 |
+
|
| 60 |
+
```python
|
| 61 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 62 |
+
import torch
|
| 63 |
+
|
| 64 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 65 |
+
"rudranshjoshi/circuit",
|
| 66 |
+
torch_dtype=torch.float16,
|
| 67 |
+
trust_remote_code=True
|
| 68 |
+
)
|
| 69 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
| 70 |
+
"rudranshjoshi/circuit",
|
| 71 |
+
trust_remote_code=True
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 75 |
+
model.to(device)
|
| 76 |
+
|
| 77 |
+
prompt = "Your prompt here"
|
| 78 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(device)
|
| 79 |
+
outputs = model.generate(**inputs, max_new_tokens=150)
|
| 80 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 81 |
+
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
# Training Summary
|
| 86 |
+
|
| 87 |
+
Base model: Phi-3 Mini 4K Instruct
|
| 88 |
+
|
| 89 |
+
Dataset: LogiQA (lucasmccabe/logiqa)
|
| 90 |
+
|
| 91 |
+
Training method: LoRA fine-tuning, later merged
|
| 92 |
+
|
| 93 |
+
Hardware: NVIDIA RTX 1080
|
| 94 |
+
|
| 95 |
+
Epochs: ~3
|
| 96 |
+
|
| 97 |
+
Objective: Improve reasoning consistency and structured explanations
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
# Acknowledgements
|
| 102 |
+
|
| 103 |
+
Microsoft
|
| 104 |
+
for Phi-3
|
| 105 |
+
|
| 106 |
+
Lucas McCabe
|
| 107 |
+
for LogiQA dataset
|
| 108 |
+
|
| 109 |
+
Fine-tuned and quantized by Rudransh under Project Circuit
|