oriolrius commited on
Commit
726547f
·
verified ·
1 Parent(s): 966149f

Upload phi3mini4k-minimal-r32-a64-e20-20250914-132416-ollama-docker-20250915-125110

Browse files
Files changed (8) hide show
  1. .gitattributes +1 -0
  2. Modelfile +6 -0
  3. README.md +70 -0
  4. docker-compose.yml +14 -0
  5. export_metadata.json +7 -0
  6. model.gguf +3 -0
  7. setup_ollama.sh +14 -0
  8. test_model.sh +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ model.gguf filter=lfs diff=lfs merge=lfs -text
Modelfile ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ FROM model.gguf
2
+
3
+ PARAMETER temperature 0.7
4
+ PARAMETER top_p 0.9
5
+ PARAMETER top_k 40
6
+ PARAMETER num_predict 2048
README.md ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Phi-3 Mini 4K AVRO Fine-tuned Model (Ollama)
2
+
3
+ This is a fine-tuned version of Microsoft's Phi-3 Mini 4K model, specifically trained on AVRO-related tasks and exported for use with Ollama.
4
+
5
+ ## Model Details
6
+
7
+ - **Base Model**: Microsoft Phi-3 Mini 4K
8
+ - **Fine-tuning**: LoRA with rank 32, alpha 64, 20 epochs
9
+ - **Export Format**: GGUF (Quantized q4_k_m)
10
+ - **Export Date**: 2025-09-15
11
+ - **Export Tool**: Docker-based Ollama export
12
+ - **Model Size**: ~7.2GB (quantized)
13
+
14
+ ## Files
15
+
16
+ - `model.gguf`: The quantized model file in GGUF format
17
+ - `Modelfile`: Ollama configuration file with model parameters
18
+ - `docker-compose.yml`: Docker setup for running the model
19
+ - `setup_ollama.sh`: Script to set up Ollama with this model
20
+ - `test_model.sh`: Script to test the model functionality
21
+
22
+ ## Usage
23
+
24
+ ### With Ollama
25
+
26
+ 1. Download the model files
27
+ 2. Run the setup script:
28
+ ```bash
29
+ chmod +x setup_ollama.sh
30
+ ./setup_ollama.sh
31
+ ```
32
+
33
+ 3. Use the model:
34
+ ```bash
35
+ ollama run phi3-avro
36
+ ```
37
+
38
+ ### With Docker Compose
39
+
40
+ ```bash
41
+ docker-compose up -d
42
+ ```
43
+
44
+ ## Model Parameters
45
+
46
+ - Temperature: 0.7
47
+ - Top-p: 0.9
48
+ - Top-k: 40
49
+ - Max tokens: 2048
50
+
51
+ ## Fine-tuning Details
52
+
53
+ This model was fine-tuned using LoRA (Low-Rank Adaptation) technique:
54
+ - Rank: 32
55
+ - Alpha: 64
56
+ - Training epochs: 20
57
+ - Training completed: 2025-09-14
58
+
59
+ The model has been specifically trained to understand and work with AVRO schemas, data serialization, and related data engineering tasks.
60
+
61
+ ## License
62
+
63
+ This model inherits the license from the base Phi-3 Mini model. Please refer to Microsoft's Phi-3 licensing terms.
64
+
65
+ ## Technical Specifications
66
+
67
+ - Quantization: q4_k_m (4-bit quantization with k-means)
68
+ - Context length: 4096 tokens
69
+ - Export method: Docker container compilation
70
+ - Compatible with: Ollama, llama.cpp ecosystem
docker-compose.yml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: '3.8'
2
+
3
+ services:
4
+ ollama:
5
+ image: ollama/ollama:latest
6
+ ports:
7
+ - "11434:11434"
8
+ volumes:
9
+ - .:/models
10
+ - ollama:/root/.ollama
11
+ restart: unless-stopped
12
+
13
+ volumes:
14
+ ollama: {}
export_metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "adapter_path": "avro-phi3-adapters/phi3mini4k-minimal-r32-a64-e20-20250914-132416",
3
+ "quantization": "q4_k_m",
4
+ "timestamp": "2025-09-15T12:51:51.170225",
5
+ "export_tool": "export_ollama_docker.py",
6
+ "method": "docker (no compilation)"
7
+ }
model.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b9755327dd5846232607ae4069d4bfcc641a117de2583aa2a74611d4e0cb729c
3
+ size 7643295872
setup_ollama.sh ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ echo "🚀 Starting Ollama server..."
5
+ docker compose up -d
6
+
7
+ echo "⏳ Waiting for Ollama to start..."
8
+ sleep 5
9
+
10
+ echo "📦 Creating model 'phi3mini4k-minimal-r32-a64-e20-20250914-132416'..."
11
+ docker compose exec -T ollama ollama create phi3mini4k-minimal-r32-a64-e20-20250914-132416 -f /models/Modelfile
12
+
13
+ echo "✅ Model ready! Test with:"
14
+ echo " docker compose exec ollama ollama run phi3mini4k-minimal-r32-a64-e20-20250914-132416 'What is AVRO?'"
test_model.sh ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ #!/bin/bash
2
+ echo "Testing phi3mini4k-minimal-r32-a64-e20-20250914-132416..."
3
+ docker compose exec ollama ollama run phi3mini4k-minimal-r32-a64-e20-20250914-132416 "Create an AVRO schema for a user with name and email"