Update app.py
Browse files
app.py
CHANGED
@@ -95,6 +95,10 @@ def train_lora(image_folder, metadata):
|
|
95 |
if batch_idx % 10 == 0:
|
96 |
print(f"Batch {batch_idx}, Loss: {loss.item()}")
|
97 |
|
|
|
|
|
|
|
|
|
98 |
print("LoRA training completed.")
|
99 |
|
100 |
# Gradio App
|
|
|
95 |
if batch_idx % 10 == 0:
|
96 |
print(f"Batch {batch_idx}, Loss: {loss.item()}")
|
97 |
|
98 |
+
# Save the trained model
|
99 |
+
torch.save(model.state_dict(), "lora_model.pth")
|
100 |
+
print("Model saved as lora_model.pth")
|
101 |
+
|
102 |
print("LoRA training completed.")
|
103 |
|
104 |
# Gradio App
|