Spaces:
Sleeping
Sleeping
Gabriel
commited on
Commit
·
e83839b
1
Parent(s):
c48b9e5
fix
Browse files
app.py
CHANGED
@@ -2,28 +2,25 @@ import gradio as gr
|
|
2 |
import torch
|
3 |
from torch import tensor
|
4 |
from torch.nn import functional as F
|
5 |
-
from sklearn.preprocessing import LabelEncoder
|
6 |
import pandas as pd
|
7 |
|
8 |
-
label_encoder = LabelEncoder()
|
9 |
-
|
10 |
model = torch.load('model.pkl')
|
11 |
|
12 |
def calc(X_test):
|
13 |
# return model.predict(X_test)
|
14 |
return X_test
|
15 |
|
16 |
-
def main(inputs):
|
17 |
-
|
18 |
-
|
19 |
|
20 |
-
|
21 |
-
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
|
28 |
iface = gr.Interface(
|
29 |
fn=calc,
|
|
|
2 |
import torch
|
3 |
from torch import tensor
|
4 |
from torch.nn import functional as F
|
|
|
5 |
import pandas as pd
|
6 |
|
|
|
|
|
7 |
model = torch.load('model.pkl')
|
8 |
|
9 |
def calc(X_test):
|
10 |
# return model.predict(X_test)
|
11 |
return X_test
|
12 |
|
13 |
+
# def main(inputs):
|
14 |
+
# df = pd.DataFrame(columns=inputs[1:])
|
15 |
+
# df.loc[0] = inputs[1:]
|
16 |
|
17 |
+
# for column in df.columns:
|
18 |
+
# df[column] = label_encoder.fit_transform(df[column])
|
19 |
|
20 |
+
# t_indep = tensor(df[indep_cols].values, dtype=torch.float)
|
21 |
+
# vals,indices = t_indep.max(dim=0)
|
22 |
+
# t_indep = t_indep / vals
|
23 |
+
# return calc_preds(coeffs, t_indep)
|
24 |
|
25 |
iface = gr.Interface(
|
26 |
fn=calc,
|