SudharsanSundar's picture
Testing better app
38a8ac5
raw
history blame
542 Bytes
import evaluate
import gradio as gr
from evaluate.utils import launch_gradio_widget
# token_edit_distance_metric = evaluate.load("SudharsanSundar/token_edit_distance")
# launch_gradio_widget(module)
def evaluate_metric(input, ref):
return token_edit_distance_metric.compute(predictions=input, references=ref)['avg_token_edit_distance']
demo = gr.Interface(
fn=evaluate_metric,
inputs=[gr.Dataframe(row_count = (2, "dynamic"), col_count=(4,"dynamic"), label="Input Data", interactive=1)],
outputs="number"
)
demo.launch()