Spaces:
Runtime error
Runtime error
fuhsiao418
commited on
Commit
·
411567e
1
Parent(s):
cb10343
update
Browse files
app.py
CHANGED
|
@@ -3,9 +3,15 @@ import gradio as gr
|
|
| 3 |
|
| 4 |
|
| 5 |
def main(file, ext_threshold, article_type):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
paper = read_text_to_json(file.name)
|
|
|
|
| 7 |
if not is_valid_format(paper):
|
| 8 |
return "invalid_format"
|
|
|
|
| 9 |
sentJson = convert_to_sentence_json(paper)
|
| 10 |
sentFeat = extract_sentence_features(sentJson)
|
| 11 |
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
def main(file, ext_threshold, article_type):
|
| 6 |
+
|
| 7 |
+
if file is None or ext_threshold is None or article_type is None:
|
| 8 |
+
return 'error'
|
| 9 |
+
|
| 10 |
paper = read_text_to_json(file.name)
|
| 11 |
+
|
| 12 |
if not is_valid_format(paper):
|
| 13 |
return "invalid_format"
|
| 14 |
+
|
| 15 |
sentJson = convert_to_sentence_json(paper)
|
| 16 |
sentFeat = extract_sentence_features(sentJson)
|
| 17 |
|