Spaces:
Runtime error
Runtime error
app
Browse files
app.py
CHANGED
|
@@ -6,8 +6,8 @@ import numpy as np
|
|
| 6 |
|
| 7 |
model = from_pretrained_keras("keras-io/timeseries_transformer_classification")
|
| 8 |
|
| 9 |
-
def detect_issue(
|
| 10 |
-
|
| 11 |
pred = model.predict(df)[0]
|
| 12 |
problem = 'No problem'
|
| 13 |
if(np.argmax(pred)==1):
|
|
@@ -15,7 +15,7 @@ def detect_issue(df):
|
|
| 15 |
return problem, pred[1]
|
| 16 |
|
| 17 |
|
| 18 |
-
iface = gr.Interface(detect_issue,"
|
| 19 |
outputs=[
|
| 20 |
gr.outputs.Textbox(label="Engine issue"),
|
| 21 |
gr.outputs.Textbox(label="Engine issue score")], examples=["sample.csv"]
|
|
|
|
| 6 |
|
| 7 |
model = from_pretrained_keras("keras-io/timeseries_transformer_classification")
|
| 8 |
|
| 9 |
+
def detect_issue(file):
|
| 10 |
+
df = pd.read_csv(file,header=None)
|
| 11 |
pred = model.predict(df)[0]
|
| 12 |
problem = 'No problem'
|
| 13 |
if(np.argmax(pred)==1):
|
|
|
|
| 15 |
return problem, pred[1]
|
| 16 |
|
| 17 |
|
| 18 |
+
iface = gr.Interface(detect_issue,gr.inputs.File(label="csv file"),
|
| 19 |
outputs=[
|
| 20 |
gr.outputs.Textbox(label="Engine issue"),
|
| 21 |
gr.outputs.Textbox(label="Engine issue score")], examples=["sample.csv"]
|