Spaces:
Runtime error
Runtime error
freemt
commited on
Commit
·
94fcac2
1
Parent(s):
d25a2bd
app.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
"""Bootstrap."""
|
2 |
# pylint: disable=invalid-name
|
3 |
-
from typing import List
|
|
|
|
|
|
|
4 |
import numpy as np
|
5 |
import pandas as pd
|
6 |
-
import gradio as gr
|
7 |
from hf_model_s import model_s
|
8 |
-
import logzero
|
9 |
from logzero import logger
|
10 |
from set_loglevel import set_loglevel
|
11 |
|
@@ -19,7 +20,7 @@ model = model_s()
|
|
19 |
|
20 |
# def fn(text1: str, text2: str) -> np.ndarray:
|
21 |
# def fn(text1: str, text2: str) -> pd.DataFrame:
|
22 |
-
def fn(text1: str, text2: str) -> List:
|
23 |
"""Define."""
|
24 |
list1 = [elm.strip() for elm in text1.splitlines() if elm.strip()]
|
25 |
list2 = [elm.strip() for elm in text2.splitlines() if elm.strip()]
|
@@ -53,7 +54,7 @@ out_df = gr.outputs.Dataframe(
|
|
53 |
type="auto",
|
54 |
label="cmat",
|
55 |
)
|
56 |
-
out_text = gr.outputs.Textbox(
|
57 |
|
58 |
# _ = """
|
59 |
try:
|
|
|
1 |
"""Bootstrap."""
|
2 |
# pylint: disable=invalid-name
|
3 |
+
from typing import Any, List, Union
|
4 |
+
|
5 |
+
import gradio as gr
|
6 |
+
import logzero
|
7 |
import numpy as np
|
8 |
import pandas as pd
|
|
|
9 |
from hf_model_s import model_s
|
|
|
10 |
from logzero import logger
|
11 |
from set_loglevel import set_loglevel
|
12 |
|
|
|
20 |
|
21 |
# def fn(text1: str, text2: str) -> np.ndarray:
|
22 |
# def fn(text1: str, text2: str) -> pd.DataFrame:
|
23 |
+
def fn(text1: str, text2: str) -> Union[List[Any], str]:
|
24 |
"""Define."""
|
25 |
list1 = [elm.strip() for elm in text1.splitlines() if elm.strip()]
|
26 |
list2 = [elm.strip() for elm in text2.splitlines() if elm.strip()]
|
|
|
54 |
type="auto",
|
55 |
label="cmat",
|
56 |
)
|
57 |
+
out_text = gr.outputs.Textbox(label="cmat")
|
58 |
|
59 |
# _ = """
|
60 |
try:
|