Spaces:
Paused
Paused
Update finetune.py
Browse files- finetune.py +7 -2
finetune.py
CHANGED
@@ -172,9 +172,12 @@ model.state_dict = (
|
|
172 |
import gradio as gr
|
173 |
|
174 |
def train():
|
|
|
175 |
# Call your trainer's train() function here
|
176 |
trainer.train()
|
177 |
print("Training complete.") # optional message to display when training is done
|
|
|
|
|
178 |
|
179 |
iface = gr.Interface(
|
180 |
fn=train,
|
@@ -188,7 +191,9 @@ iface = gr.Interface(
|
|
188 |
allow_screenshot=False
|
189 |
)
|
190 |
|
191 |
-
|
192 |
-
|
|
|
|
|
193 |
|
194 |
|
|
|
172 |
import gradio as gr
|
173 |
|
174 |
def train():
|
175 |
+
print(os.listdir(OUTPUT_DIR))
|
176 |
# Call your trainer's train() function here
|
177 |
trainer.train()
|
178 |
print("Training complete.") # optional message to display when training is done
|
179 |
+
model.save_pretrained(OUTPUT_DIR)
|
180 |
+
repo.push_to_hub(OUTPUT_DIR, commit_message="Ft model")
|
181 |
|
182 |
iface = gr.Interface(
|
183 |
fn=train,
|
|
|
191 |
allow_screenshot=False
|
192 |
)
|
193 |
|
194 |
+
if __name__ == '__main__':
|
195 |
+
iface.launch()
|
196 |
+
|
197 |
+
|
198 |
|
199 |
|