Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from huggingface_hub import from_pretrained_keras | |
| import pandas as pd | |
| import numpy as np | |
| model = from_pretrained_keras("keras-io/timeseries_transformer_classification") | |
| def detect_issue(df): | |
| df = pd.read_csv('sample.csv',header=None) | |
| pred = model.predict(df)[0] | |
| problem = 'No problem' | |
| if(np.argmax(pred)==1): | |
| problem = 'Engine problem' | |
| return problem, pred[1] | |
| iface = gr.Interface(detect_issue,"dataframe",outputs=[ | |
| gr.outputs.Textbox(label="Engine issue"), | |
| gr.outputs.Textbox(label="Engine issue score")], | |
| # examples = [["examples/sample.csv"]] | |
| ) | |
| iface.launch() | |