Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,13 +14,13 @@ ner_pipeline = pipeline("token-classification", model="projecte-aina/multiner_ce
|
|
14 |
|
15 |
def submit_input(text):
|
16 |
if text.strip() == "":
|
17 |
-
gr.Warning('Not possible to
|
18 |
return None
|
19 |
|
20 |
model_output = ner_pipeline(text)
|
21 |
|
22 |
if model_output is None:
|
23 |
-
gr.Warning('
|
24 |
|
25 |
return {"text": text, "entities": model_output}
|
26 |
|
|
|
14 |
|
15 |
def submit_input(text):
|
16 |
if text.strip() == "":
|
17 |
+
gr.Warning('Not possible to process an empty input')
|
18 |
return None
|
19 |
|
20 |
model_output = ner_pipeline(text)
|
21 |
|
22 |
if model_output is None:
|
23 |
+
gr.Warning('An error occurred. Please try again later.')
|
24 |
|
25 |
return {"text": text, "entities": model_output}
|
26 |
|