Spaces:
Build error
Build error
freemt
commited on
Commit
·
efbffad
1
Parent(s):
9057922
Debug
Browse files- ubee/__main__.py +16 -7
ubee/__main__.py
CHANGED
|
@@ -35,8 +35,8 @@ from logzero import logger
|
|
| 35 |
# for embeddable python
|
| 36 |
# if "." not in sys.path: sys.path.insert(0, ".")
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
|
| 41 |
# logzero.loglevel(10)
|
| 42 |
logger.debug(" debug on ")
|
|
@@ -52,8 +52,9 @@ ic.enable()
|
|
| 52 |
ic(" ic.enabled ")
|
| 53 |
|
| 54 |
ic("Testing...")
|
| 55 |
-
|
| 56 |
-
|
|
|
|
| 57 |
print("gradio version", gr.__version__)
|
| 58 |
|
| 59 |
try:
|
|
@@ -67,9 +68,12 @@ try:
|
|
| 67 |
except Exception as _:
|
| 68 |
ic(["load_model(\"clas-l-user\")", _])
|
| 69 |
|
| 70 |
-
_ = clas("love", ["liebe", "hate you", "test"])
|
| 71 |
-
print(_)
|
| 72 |
-
raise SystemExit("Exit by intention")
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
|
| 75 |
# segment: str
|
|
@@ -86,6 +90,8 @@ def ifn(
|
|
| 86 |
Returns:
|
| 87 |
pd.DataFrame
|
| 88 |
"""
|
|
|
|
|
|
|
| 89 |
res1 = [elm.strip() for elm in text1.splitlines() if elm.strip()]
|
| 90 |
res2 = [elm.strip() for elm in text2.splitlines() if elm.strip()]
|
| 91 |
|
|
@@ -311,6 +317,9 @@ def main():
|
|
| 311 |
]
|
| 312 |
)
|
| 313 |
|
|
|
|
|
|
|
|
|
|
| 314 |
|
| 315 |
if __name__ == "__main__":
|
| 316 |
logger.info(" Start main()")
|
|
|
|
| 35 |
# for embeddable python
|
| 36 |
# if "." not in sys.path: sys.path.insert(0, ".")
|
| 37 |
|
| 38 |
+
from ubee import __version__
|
| 39 |
+
from ubee.ubee import ubee
|
| 40 |
|
| 41 |
# logzero.loglevel(10)
|
| 42 |
logger.debug(" debug on ")
|
|
|
|
| 52 |
ic(" ic.enabled ")
|
| 53 |
|
| 54 |
ic("Testing...")
|
| 55 |
+
import model_pool
|
| 56 |
+
from model_pool import fetch_check_aux
|
| 57 |
+
print("model-pool version", model_pool.__version__)
|
| 58 |
print("gradio version", gr.__version__)
|
| 59 |
|
| 60 |
try:
|
|
|
|
| 68 |
except Exception as _:
|
| 69 |
ic(["load_model(\"clas-l-user\")", _])
|
| 70 |
|
| 71 |
+
# _ = clas("love", ["liebe", "hate you", "test"])
|
| 72 |
+
# print(_)
|
| 73 |
+
# raise SystemExit("Exit by intention")
|
| 74 |
+
# {'sequence': 'love', 'labels': ['liebe', 'test', 'hate you'],
|
| 75 |
+
# 'scores': [0.8885253667831421, 0.10581762343645096, 0.005657028406858444]}
|
| 76 |
+
# Runs OK
|
| 77 |
|
| 78 |
|
| 79 |
# segment: str
|
|
|
|
| 90 |
Returns:
|
| 91 |
pd.DataFrame
|
| 92 |
"""
|
| 93 |
+
global text1, text2, thresh
|
| 94 |
+
|
| 95 |
res1 = [elm.strip() for elm in text1.splitlines() if elm.strip()]
|
| 96 |
res2 = [elm.strip() for elm in text2.splitlines() if elm.strip()]
|
| 97 |
|
|
|
|
| 317 |
]
|
| 318 |
)
|
| 319 |
|
| 320 |
+
# blocks.launch()
|
| 321 |
+
blocks.launch(debug=True, enable_queue=True)
|
| 322 |
+
|
| 323 |
|
| 324 |
if __name__ == "__main__":
|
| 325 |
logger.info(" Start main()")
|