joheras commited on
Commit
736f47f
·
1 Parent(s): a4cdb6c
Files changed (1) hide show
  1. app.py +3 -3
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(df):
10
- #df = pd.read_csv('sample.csv',header=None)
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,"dataframe",
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"]