Update app.py
Browse files
app.py
CHANGED
|
@@ -76,7 +76,7 @@ class CustomTrainerCallback(TrainerCallback):
|
|
| 76 |
job.progress = 0.1 + (prog * 0.8)
|
| 77 |
if state.global_step % 1 == 0:
|
| 78 |
loss = state.log_history[-1].get('loss', 'N/A') if state.log_history else '...'
|
| 79 |
-
job.add_log(f"
|
| 80 |
return control
|
| 81 |
|
| 82 |
def on_save(self, args, state, control, **kwargs):
|
|
@@ -252,6 +252,7 @@ def background_train_task(job_id, hf_token, model_name, new_repo_name, lora_r, l
|
|
| 252 |
|
| 253 |
job.set_progress(0.2, "Training: Matrix Optimization Initiated...")
|
| 254 |
trainer.train()
|
|
|
|
| 255 |
|
| 256 |
job.set_progress(0.9, "Processing: Fusing Tensors...")
|
| 257 |
del peft_model
|
|
@@ -361,7 +362,7 @@ def load_from_url(request: gr.Request):
|
|
| 361 |
pass
|
| 362 |
return gr.update(selected="launch_tab"), ""
|
| 363 |
|
| 364 |
-
with gr.Blocks(title="Nucleus Enterprise") as demo:
|
| 365 |
with gr.Column():
|
| 366 |
gr.Markdown("# ⚛️ NUCLEUS ENTERPRISE")
|
| 367 |
gr.Markdown("Autonomous LLM Foundry | V5.0 Stable")
|
|
|
|
| 76 |
job.progress = 0.1 + (prog * 0.8)
|
| 77 |
if state.global_step % 1 == 0:
|
| 78 |
loss = state.log_history[-1].get('loss', 'N/A') if state.log_history else '...'
|
| 79 |
+
job.add_log(f"Step {state.global_step}/{state.max_steps} | Loss: {loss}")
|
| 80 |
return control
|
| 81 |
|
| 82 |
def on_save(self, args, state, control, **kwargs):
|
|
|
|
| 252 |
|
| 253 |
job.set_progress(0.2, "Training: Matrix Optimization Initiated...")
|
| 254 |
trainer.train()
|
| 255 |
+
trainer.save_model(output_dir)
|
| 256 |
|
| 257 |
job.set_progress(0.9, "Processing: Fusing Tensors...")
|
| 258 |
del peft_model
|
|
|
|
| 362 |
pass
|
| 363 |
return gr.update(selected="launch_tab"), ""
|
| 364 |
|
| 365 |
+
with gr.Blocks(title="Nucleus Enterprise", theme=gr.themes.Base()) as demo:
|
| 366 |
with gr.Column():
|
| 367 |
gr.Markdown("# ⚛️ NUCLEUS ENTERPRISE")
|
| 368 |
gr.Markdown("Autonomous LLM Foundry | V5.0 Stable")
|