Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,12 +2,14 @@ import os
|
|
2 |
import re
|
3 |
import sys
|
4 |
import json
|
|
|
5 |
from pathlib import Path
|
6 |
|
7 |
import evaluate
|
8 |
import numpy as np
|
9 |
from datasets import Value
|
10 |
|
|
|
11 |
REGEX_YAML_BLOCK = re.compile(r"---[\n\r]+([\S\s]*?)[\n\r]+---[\n\r]")
|
12 |
|
13 |
|
@@ -91,7 +93,7 @@ def launch_gradio_widget(metric):
|
|
91 |
try:
|
92 |
import gradio as gr
|
93 |
except ImportError as error:
|
94 |
-
|
95 |
raise error
|
96 |
|
97 |
local_path = Path(sys.path[0])
|
|
|
2 |
import re
|
3 |
import sys
|
4 |
import json
|
5 |
+
import logging
|
6 |
from pathlib import Path
|
7 |
|
8 |
import evaluate
|
9 |
import numpy as np
|
10 |
from datasets import Value
|
11 |
|
12 |
+
logger = logging.getLogger(__name__)
|
13 |
REGEX_YAML_BLOCK = re.compile(r"---[\n\r]+([\S\s]*?)[\n\r]+---[\n\r]")
|
14 |
|
15 |
|
|
|
93 |
try:
|
94 |
import gradio as gr
|
95 |
except ImportError as error:
|
96 |
+
logger.info("To create a metric widget with Gradio make sure gradio is installed.")
|
97 |
raise error
|
98 |
|
99 |
local_path = Path(sys.path[0])
|