Spaces:
Runtime error
Runtime error
freemt
commited on
Commit
·
d80396f
1
Parent(s):
28e94e4
app.py
CHANGED
@@ -12,7 +12,6 @@ from set_loglevel import set_loglevel
|
|
12 |
|
13 |
from gradio_cmat.gradio_cmat import gradio_cmat
|
14 |
|
15 |
-
logger.info("gradio version: %s", gr.__version__)
|
16 |
|
17 |
pd.set_option("display.precision", 2)
|
18 |
pd.options.display.float_format = "{:,.2f}".format
|
@@ -24,6 +23,7 @@ logzero.loglevel(set_loglevel(10, force=True))
|
|
24 |
# def fn(text1: str, text2: str) -> pd.DataFrame:
|
25 |
def fn(text1: str, text2: str) -> Union[List[Any], str]:
|
26 |
"""Define."""
|
|
|
27 |
list1 = [elm.strip() for elm in text1.splitlines() if elm.strip()]
|
28 |
list2 = [elm.strip() for elm in text2.splitlines() if elm.strip()]
|
29 |
|
@@ -45,10 +45,10 @@ def fn(text1: str, text2: str) -> Union[List[Any], str]:
|
|
45 |
return str(e)
|
46 |
# raise
|
47 |
|
48 |
-
round2 = lambda x: round(x,
|
49 |
vfunc = np.vectorize(round2)
|
50 |
|
51 |
-
return vfunc(res)
|
52 |
# return pd.DataFrame(res)
|
53 |
# return str(res.tolist())
|
54 |
|
|
|
12 |
|
13 |
from gradio_cmat.gradio_cmat import gradio_cmat
|
14 |
|
|
|
15 |
|
16 |
pd.set_option("display.precision", 2)
|
17 |
pd.options.display.float_format = "{:,.2f}".format
|
|
|
23 |
# def fn(text1: str, text2: str) -> pd.DataFrame:
|
24 |
def fn(text1: str, text2: str) -> Union[List[Any], str]:
|
25 |
"""Define."""
|
26 |
+
logger.info("gradio version: %s", gr.__version__)
|
27 |
list1 = [elm.strip() for elm in text1.splitlines() if elm.strip()]
|
28 |
list2 = [elm.strip() for elm in text2.splitlines() if elm.strip()]
|
29 |
|
|
|
45 |
return str(e)
|
46 |
# raise
|
47 |
|
48 |
+
round2 = lambda x: round(x, 2)
|
49 |
vfunc = np.vectorize(round2)
|
50 |
|
51 |
+
return pd.DataFrame(vfunc(res), dtype="object")
|
52 |
# return pd.DataFrame(res)
|
53 |
# return str(res.tolist())
|
54 |
|