Gemma training script

This commit is contained in:
Niels Geens
2025-05-20 20:46:16 +02:00
parent d4a4902b94
commit f2c70cd05d
14 changed files with 394 additions and 207 deletions

View File

@@ -1,91 +1,3 @@
gemma = """/root/venvs/gemma_infer/bin/gemma_infer --model /root/models/gemma3_1b.gguf --tokenizer /root/models/gemma3_1b_tokenizer"""
gemma = """gemma_infer --model /root/models/current/model.gguf --tokenizer /root/models/current/tokenizer"""
#mistral = """/root/venvs/mistral_infer/bin/mistral_infer"""
default = """#!/bin/bash
# Mock LLM engine for testing
# This script simulates an LLM engine subprocess that responds to the three commands:
# <token_limit/>, <token_count>...</token_count>, and <infer_xml>...</infer_xml>
# Function to read XML input until a complete closing tag is found
read_xml_input() {
local input=""
local line
local char_count=0
# Read until we get a complete XML command
while IFS= read -r line; do
input="${input}${line}"
char_count=$((char_count + ${#line}))
# Debug the actual content (first 30 chars)
if [[ "$input" == *"<token_limit/>"* ]]; then
printf "1024"
printf "\\004" # EOT character (hex 04)
return
fi
if [[ "$input" == *"<token_count>"*"</token_count>"* ]]; then
printf "405"
printf "\\004" # EOT character (hex 04)
return
fi
if [[ "$input" == *"<infer_xml>"*"</infer_xml>"* ]]; then
generate_response
return
fi
done
}
# Function to generate a response token by token
generate_response() {
printf "<"
sleep 0.3
printf "reason"
sleep 0.3
printf "ing"
sleep 0.3
printf ">"
sleep 0.3
printf "This"
sleep 0.3
printf " is"
sleep 0.3
printf " a"
sleep 0.3
printf " test"
sleep 0.3
printf " response."
sleep 0.3
printf "</"
sleep 0.3
printf "reason"
sleep 0.3
printf "ing"
sleep 0.3
printf ">"
sleep 0.3
printf "\\004"
}
# Main loop - keep reading input and responding
iteration=0
while true; do
iteration=$((iteration + 1))
read_xml_input
done"""
default = """/root/sia/scripts/mock_llm.sh"""