Translate user-facing runtime output to English, machine prefixes preserved, + CLI output test (#67, #85)
* feat: standardize runtime output in English * test: cover English CLI output
This commit is contained in:
@@ -13,7 +13,7 @@ STALL_S=180 # secondi senza crescita del download -> riavvio
|
||||
CONVLOG=/tmp/convert_supervised.log
|
||||
|
||||
exec 9>"$DIR/.supervisor.lock"
|
||||
flock -n 9 || { echo "supervisore gia' attivo, esco"; exit 1; }
|
||||
flock -n 9 || { echo "a supervisor is already running; exiting"; exit 1; }
|
||||
|
||||
log(){ echo "[$(date +%H:%M:%S)] $*"; }
|
||||
|
||||
@@ -21,16 +21,16 @@ start_conv(){
|
||||
cd "$CODE"
|
||||
nohup python3 tools/convert_fp8_to_int4.py --repo zai-org/GLM-5.2-FP8 \
|
||||
--outdir "$DIR" --ebits 4 --io-bits 8 >> "$CONVLOG" 2>&1 &
|
||||
log "convertitore avviato (PID $!)"
|
||||
log "converter started (PID $!)"
|
||||
}
|
||||
|
||||
last_size=-1; stall=0
|
||||
while :; do
|
||||
done_n=$(ls "$DIR"/out-*.safetensors 2>/dev/null | wc -l)
|
||||
if [ "$done_n" -ge "$TOTAL" ]; then log "FATTO: $done_n/$TOTAL shard. Esco."; pkill -f convert_fp8 2>/dev/null; exit 0; fi
|
||||
if [ "$done_n" -ge "$TOTAL" ]; then log "DONE: $done_n/$TOTAL shards. Exiting."; pkill -f convert_fp8 2>/dev/null; exit 0; fi
|
||||
|
||||
if ! pgrep -f convert_fp8 >/dev/null; then
|
||||
log "convertitore non attivo ($done_n/$TOTAL): lo avvio"
|
||||
log "converter is not running ($done_n/$TOTAL): starting it"
|
||||
start_conv; last_size=-1; stall=0; sleep 20; continue
|
||||
fi
|
||||
|
||||
@@ -40,12 +40,12 @@ while :; do
|
||||
if [ "$size" = "$last_size" ]; then
|
||||
stall=$((stall+30))
|
||||
if [ "$stall" -ge "$STALL_S" ]; then
|
||||
log "download FERMO da ${stall}s a $((size/1000000)) MB ($done_n/$TOTAL): riavvio il convertitore"
|
||||
log "download stalled for ${stall}s at $((size/1000000)) MB ($done_n/$TOTAL): restarting the converter"
|
||||
pkill -f convert_fp8; sleep 5
|
||||
start_conv; last_size=-1; stall=0
|
||||
fi
|
||||
else
|
||||
[ "$last_size" -ge 0 ] && [ "$stall" -ge 60 ] && log "download ripreso ($((size/1000000)) MB)"
|
||||
[ "$last_size" -ge 0 ] && [ "$stall" -ge 60 ] && log "download resumed ($((size/1000000)) MB)"
|
||||
last_size=$size; stall=0
|
||||
fi
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user