xszheng2020 commited on
Commit
52cdfd2
·
verified ·
1 Parent(s): b98ce2d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -162,14 +162,14 @@ def infer(inputs, additional_inputs):
162
  return [gr.ScatterPlot(
163
  value=df_val,
164
  x="Prediction",
165
- y="True Loss",
166
  title="Scatter",
167
- tooltip=["Prediction", "True Loss"],
168
  x_lim=[min(min(predictions), min(df_val[y_column]))-0.25, max(max(predictions), max(df_val[y_column]))+0.25],
169
  y_lim=[min(min(predictions), min(df_val[y_column]))-0.25, max(max(predictions), max(df_val[y_column]))+0.25]
170
  ),
171
  gr.Image(Image.open('tmp.png')),
172
- df_val[['True Loss', 'Prediction']], ]
173
 
174
  def upload_csv(file):
175
  df = pd.read_csv(file.name,
@@ -183,7 +183,7 @@ df = pd.read_csv('data.csv')
183
  headers = df.columns.tolist()
184
 
185
  inputs = [gr.Dataframe(headers=headers, row_count = (8, "dynamic"), datatype='number', col_count=(4,"fixed"), label="Dataset", interactive=1)]
186
- outputs = [gr.ScatterPlot(), gr.Image(), gr.Dataframe(row_count = (2, "dynamic"), col_count=(2, "fixed"), datatype='number', label="Results", headers=["True Loss", "Pred Loss"])]
187
 
188
  with gr.Blocks() as demo:
189
 
 
162
  return [gr.ScatterPlot(
163
  value=df_val,
164
  x="Prediction",
165
+ y="Target",
166
  title="Scatter",
167
+ tooltip=["Prediction", "Target"],
168
  x_lim=[min(min(predictions), min(df_val[y_column]))-0.25, max(max(predictions), max(df_val[y_column]))+0.25],
169
  y_lim=[min(min(predictions), min(df_val[y_column]))-0.25, max(max(predictions), max(df_val[y_column]))+0.25]
170
  ),
171
  gr.Image(Image.open('tmp.png')),
172
+ df_val[['Target', 'Prediction']], ]
173
 
174
  def upload_csv(file):
175
  df = pd.read_csv(file.name,
 
183
  headers = df.columns.tolist()
184
 
185
  inputs = [gr.Dataframe(headers=headers, row_count = (8, "dynamic"), datatype='number', col_count=(4,"fixed"), label="Dataset", interactive=1)]
186
+ outputs = [gr.ScatterPlot(), gr.Image(), gr.Dataframe(row_count = (2, "dynamic"), col_count=(2, "fixed"), datatype='number', label="Results", headers=["Target", "Prediction"])]
187
 
188
  with gr.Blocks() as demo:
189