Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,9 @@
|
|
1 |
-
from pathlib import Path
|
2 |
try:
|
3 |
-
|
4 |
except ImportError as error:
|
5 |
logger.error("To create a metric widget with Gradio make sure gradio is installed.")
|
6 |
raise error
|
7 |
|
8 |
-
local_path = Path(sys.path[0])
|
9 |
# if there are several input types, use first as default.
|
10 |
if isinstance(metric.features, list):
|
11 |
(feature_names, feature_types) = zip(*metric.features[0].items())
|
@@ -30,9 +28,7 @@ iface = gr.Interface(
|
|
30 |
" Alternatively you can use a JSON-formatted list as input."
|
31 |
),
|
32 |
title=f"Metric: {metric.name}",
|
33 |
-
article=parse_readme(local_path / "README.md"),
|
34 |
-
# TODO: load test cases and use them to populate examples
|
35 |
-
# examples=[parse_test_cases(test_cases, feature_names, gradio_input_types)]
|
36 |
)
|
37 |
|
38 |
iface.launch()
|
|
|
|
|
1 |
try:
|
2 |
+
import gradio as gr
|
3 |
except ImportError as error:
|
4 |
logger.error("To create a metric widget with Gradio make sure gradio is installed.")
|
5 |
raise error
|
6 |
|
|
|
7 |
# if there are several input types, use first as default.
|
8 |
if isinstance(metric.features, list):
|
9 |
(feature_names, feature_types) = zip(*metric.features[0].items())
|
|
|
28 |
" Alternatively you can use a JSON-formatted list as input."
|
29 |
),
|
30 |
title=f"Metric: {metric.name}",
|
31 |
+
# article=parse_readme(local_path / "README.md"),
|
|
|
|
|
32 |
)
|
33 |
|
34 |
iface.launch()
|