FredBonux commited on
Commit
137e221
·
1 Parent(s): c334bf5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -14,8 +14,8 @@ monitor_fg = fs.get_or_create_feature_group(name="wine_predictions", version=1,
14
  description="Wine quality Prediction/Outcome Monitoring")
15
 
16
  history_df = monitor_fg.read()
17
- last_prediction = history_df.tail()
18
- last_prediction = last_prediction[0] if len(last_prediction) > 0 else None
19
 
20
  with gr.Blocks() as demo:
21
  with gr.Row():
@@ -24,7 +24,7 @@ with gr.Blocks() as demo:
24
  gr.Label(f"{labels[last_prediction['prediction']] + ' quality' if last_prediction is not None else 'No predictions yet'}")
25
  with gr.Column():
26
  gr.Label("Today's Actual quality")
27
- gr.Label(f"{labels[last_prediction['label']] + ' quality' if last_prediction is not None else 'No predictions yet'}")
28
  with gr.Row():
29
  with gr.Column():
30
  gr.Label("Recent Prediction History")
 
14
  description="Wine quality Prediction/Outcome Monitoring")
15
 
16
  history_df = monitor_fg.read()
17
+ last_prediction = history_df.tail(1)
18
+ last_prediction = last_prediction.to_dict(orient='records')[0]
19
 
20
  with gr.Blocks() as demo:
21
  with gr.Row():
 
24
  gr.Label(f"{labels[last_prediction['prediction']] + ' quality' if last_prediction is not None else 'No predictions yet'}")
25
  with gr.Column():
26
  gr.Label("Today's Actual quality")
27
+ gr.Label(f"{labels[int(last_prediction['label'])] + ' quality' if last_prediction is not None else 'No predictions yet'}")
28
  with gr.Row():
29
  with gr.Column():
30
  gr.Label("Recent Prediction History")