Spaces:
Runtime error
Runtime error
File size: 902 Bytes
90f9b75 a3ecf62 bfdfdc9 90f9b75 a3ecf62 90f9b75 da6fb8e 90f9b75 9f8d320 90f9b75 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
import gradio as gr
import run
import options as op
import re
import os
REGEX_YAML_BLOCK = re.compile(r"---[\n\r]+([\S\s]*?)[\n\r]+---[\n\r]")
def parse_readme(filepath):
"""Parses a repositories README and removes"""
if not os.path.exists(filepath):
return "No README.md found."
with open(filepath, "r") as f:
text = f.read()
match = REGEX_YAML_BLOCK.search(text)
if match:
text = text[match.end() :]
return text
iface = gr.Interface(
run.tp_tf_test,
[
gr.Radio(list(op.test_datasets.keys())),
gr.Radio(list(op.metrics.keys())),
gr.Radio(list(op.models.keys())),
gr.Radio(list(op.queries.keys())),
gr.Radio(list(op.prompts.keys())),
gr.CheckboxGroup(list(op.prediction_strategy_options.keys())),
],
gr.File(),
title="Testing Zero Shot Classification by SDGs",
article=parse_readme("README.md"),
)
iface.launch()
|