yangwang825 commited on
Commit
b84573a
1 Parent(s): 1f01950

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -104,8 +104,12 @@ def launch_gradio_widget(metric):
104
  (feature_names, feature_types) = zip(*metric.features.items())
105
  gradio_input_types = infer_gradio_input_types(feature_types)
106
 
107
- def compute(predictions, references):
108
- return metric.compute([predictions], [references])
 
 
 
 
109
  # return metric.compute(**parse_gradio_data(data, gradio_input_types))
110
 
111
  iface = gr.Interface(
 
104
  (feature_names, feature_types) = zip(*metric.features.items())
105
  gradio_input_types = infer_gradio_input_types(feature_types)
106
 
107
+ def compute(prediction, reference):
108
+ data = {
109
+ "predictions": [prediction],
110
+ "references":[reference]
111
+ }
112
+ return metric.compute(data)
113
  # return metric.compute(**parse_gradio_data(data, gradio_input_types))
114
 
115
  iface = gr.Interface(