Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,14 +47,18 @@ CACHE_EXAMPLES = os.getenv('CACHE_EXAMPLES', '1') == '1'
|
|
| 47 |
def analyze(path):
|
| 48 |
#Measure time for inference
|
| 49 |
start = time.time()
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
|
|
|
| 57 |
)
|
|
|
|
|
|
|
|
|
|
| 58 |
#stems_paths_string =""
|
| 59 |
#for stem in stems_paths:
|
| 60 |
# stems_paths_string += stem + '\n'
|
|
|
|
| 47 |
def analyze(path):
|
| 48 |
#Measure time for inference
|
| 49 |
start = time.time()
|
| 50 |
+
|
| 51 |
+
try:
|
| 52 |
+
path = Path(path)
|
| 53 |
+
result, stems_paths = allin1.analyze(
|
| 54 |
+
path,
|
| 55 |
+
out_dir='./struct',
|
| 56 |
+
multiprocess=False,
|
| 57 |
+
keep_byproducts=True, # TODO: remove this
|
| 58 |
)
|
| 59 |
+
except error:
|
| 60 |
+
print(error)
|
| 61 |
+
|
| 62 |
#stems_paths_string =""
|
| 63 |
#for stem in stems_paths:
|
| 64 |
# stems_paths_string += stem + '\n'
|