Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -163,24 +163,24 @@ You are a wise teacher interpreting Bhagavad Gita with deep insights.
|
|
| 163 |
)
|
| 164 |
|
| 165 |
# ==== Train ====
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
|
| 170 |
# ==== Save model locally ====
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
|
| 176 |
# ==== Async upload ====
|
| 177 |
-
|
| 178 |
-
|
| 179 |
|
| 180 |
-
|
| 181 |
|
| 182 |
|
| 183 |
-
|
| 184 |
|
| 185 |
except Exception as e:
|
| 186 |
output_log.append(f"\n❌ Error: {e}")
|
|
|
|
| 163 |
)
|
| 164 |
|
| 165 |
# ==== Train ====
|
| 166 |
+
progress(0.7, desc="Training...")
|
| 167 |
+
output_log.append("\n🚀 Starting training...\n" + "=" * 50)
|
| 168 |
+
train_result = trainer.train()
|
| 169 |
|
| 170 |
# ==== Save model locally ====
|
| 171 |
+
progress(0.85, desc="Saving model...")
|
| 172 |
+
output_log.append("\n💾 Saving model locally...")
|
| 173 |
+
trainer.save_model(output_dir)
|
| 174 |
+
tokenizer.save_pretrained(output_dir)
|
| 175 |
|
| 176 |
# ==== Async upload ====
|
| 177 |
+
hf_repo = "rahul7star/Qwen0.5-3B-Gita"
|
| 178 |
+
asyncio.create_task(async_upload_model(output_dir, hf_repo, output_log))
|
| 179 |
|
| 180 |
+
progress(1.0, desc="Complete!")
|
| 181 |
|
| 182 |
|
| 183 |
+
output_log.append("\n✅ Training complete & model uploaded successfully!")
|
| 184 |
|
| 185 |
except Exception as e:
|
| 186 |
output_log.append(f"\n❌ Error: {e}")
|