Spaces:
Runtime error
Runtime error
File size: 641 Bytes
43ddd05 b01556d 43ddd05 b01556d 43ddd05 2cf85c2 b01556d 43ddd05 a4cdb6c bda8d2f de7f225 a4cdb6c 9e16be5 de7f225 43ddd05 4e2a9b6 |
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 |
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=["sample.csv"]
# examples = ["sample.csv"],
)
iface.launch()
|