Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import sklearn
|
|
2 |
import gradio as gr
|
3 |
import joblib
|
4 |
import pandas as pd
|
|
|
5 |
|
6 |
pipe = joblib.load("./model.pkl")
|
7 |
|
@@ -13,7 +14,9 @@ with open("./config.json") as f:
|
|
13 |
config_dict = eval(f.read())
|
14 |
headers = config_dict["sklearn"]["columns"]
|
15 |
|
16 |
-
|
|
|
|
|
17 |
df = pd.DataFrame.from_dict(example_dict,orient='index').transpose()
|
18 |
|
19 |
|
@@ -28,4 +31,4 @@ def infer(inputs):
|
|
28 |
return pd.DataFrame(predictions, columns=["results"])
|
29 |
|
30 |
gr.Interface(infer, inputs = inputs, outputs = outputs, title = title,
|
31 |
-
description = description, examples=df.
|
|
|
2 |
import gradio as gr
|
3 |
import joblib
|
4 |
import pandas as pd
|
5 |
+
import datasets
|
6 |
|
7 |
pipe = joblib.load("./model.pkl")
|
8 |
|
|
|
14 |
config_dict = eval(f.read())
|
15 |
headers = config_dict["sklearn"]["columns"]
|
16 |
|
17 |
+
df = datasets.load_dataset("merve/supersoaker-failures")
|
18 |
+
df = df["train"].to_pandas()
|
19 |
+
df.dropna(axis=0, inplace=True)
|
20 |
df = pd.DataFrame.from_dict(example_dict,orient='index').transpose()
|
21 |
|
22 |
|
|
|
31 |
return pd.DataFrame(predictions, columns=["results"])
|
32 |
|
33 |
gr.Interface(infer, inputs = inputs, outputs = outputs, title = title,
|
34 |
+
description = description, examples=df.head(3), cache_examples=False).launch(debug=True)
|