| echo "Installing Indo Math Teacher model with Gasing method..." | |
| # Check if Ollama is installed | |
| if ! command -v ollama &> /dev/null; then | |
| echo "Ollama is not installed. Please install it first: https://ollama.com" | |
| exit 1 | |
| fi | |
| # Download model files | |
| MODEL_DIR="$HOME/.ollama/models/indo_math_teacher" | |
| mkdir -p "$MODEL_DIR" | |
| echo "Downloading model files..." | |
| FILES=( | |
| "added_tokens.json" | |
| "config.json" | |
| "merges.txt" | |
| "model.safetensors" | |
| "model.safetensors.index.json" | |
| "special_tokens_map.json" | |
| "tokenizer.json" | |
| "tokenizer_config.json" | |
| "vocab.json" | |
| ) | |
| HF_REPO="Lckoo1230/indo-math-teacher-complete" | |
| for file in "${FILES[@]}"; do | |
| echo "Downloading $file..." | |
| curl -L "https://huggingface.co/$HF_REPO/resolve/main/$file" -o "$MODEL_DIR/$file" | |
| done | |
| # Create Modelfile | |
| cat > Modelfile.temp << EOL | |
| FROM qwen/Qwen2.5-1.5B | |
| SYSTEM "You are a math teacher using the Gasing method" | |
| PARAMETER temperature 0.1 | |
| PARAMETER top_p 0.9 | |
| PARAMETER num_predict 200 | |
| # Set stop sequences | |
| TEMPLATE "{{ .System }}\n\n{{ .Prompt }}" | |
| STOP "[/INST]" | |
| STOP ">>> " | |
| STOP "\n\nHuman:" | |
| STOP "\nHuman:" | |
| EOL | |
| # Create the model in Ollama | |
| ollama create indo_math_teacher -f Modelfile.temp | |
| echo "Indo Math Teacher installed successfully!" | |
| echo "Run with: ollama run indo_math_teacher" | |
| echo "" | |
| echo "Example: Jelaskan cara menghitung 8 ditambah 5 menggunakan metode Gasing!" | |