chore(lora): Add real-time log buffering fix for nohup execution (#1311)

* chore(lora): Add real-time log buffering fix for nohup execution

Disable Python stdout buffering to ensure logs appear in nohup.out in real-time instead of only after script completion.

* chore(lora): remove python 3.7+ check

* chore(lora): running pre-commit hook

---------

Co-authored-by: Pierre-Louis Létoquart <randlgint@proton.me>
This commit is contained in:
Pierre-Louis 2025-03-03 09:12:33 -05:00 committed by GitHub
parent 269faa5fa4
commit 1bc3476a46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,7 @@
import argparse
import json
import math
import sys
import time
from pathlib import Path
@ -14,6 +15,9 @@ import utils as lora_utils
from mlx.utils import tree_flatten
from models import LoRALinear
# Disable output buffering to see print statements in real-time
sys.stdout.reconfigure(line_buffering=True)
def build_parser():
parser = argparse.ArgumentParser(description="LoRA or QLoRA finetuning.")