Spaces:
Build error
Build error
File size: 758 Bytes
cce945c 6eb15d0 cce945c 679a7b2 cce945c 6eb15d0 679a7b2 6eb15d0 679a7b2 6eb15d0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 11 10:26:15 2023
@author: peter
"""
import gradio as gr
import scripts
import pandas
def download(button):
scripts.download_training_data()
return gr.Button.update(interactive=True)
def train():
history = scripts.train_models('PlayfulTechnology')
return pandas.DataFrame(history).plot.line(subplots=True)
with gr.Blocks() as trainer:
download_button = gr.Button(value='Doenload training_data')
training_button = gr.Button(value="Train models",interactive=False)
loss_plot = gr.Plot()
download_button.click(download,inputs=download_button,outputs=training_button)
training_button.click(train,inputs=[],outputs=[loss_plot])
trainer.launch()
|