Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,11 +36,11 @@ def read_file(file, file_type):
|
|
| 36 |
# Function to process the file and generate outputs
|
| 37 |
def process_file(file, file_type, language="en"):
|
| 38 |
content = read_file(file, file_type)
|
| 39 |
-
|
| 40 |
# Check if content is not empty
|
| 41 |
if not content.strip():
|
| 42 |
return "Error: The document is empty or unsupported format.", None, None, None, None, None
|
| 43 |
-
|
| 44 |
# Summarize the content
|
| 45 |
try:
|
| 46 |
summary = summarizer(content, max_length=150, min_length=50, do_sample=False)
|
|
@@ -99,3 +99,4 @@ iface = gr.Interface(
|
|
| 99 |
)
|
| 100 |
|
| 101 |
iface.launch()
|
|
|
|
|
|
| 36 |
# Function to process the file and generate outputs
|
| 37 |
def process_file(file, file_type, language="en"):
|
| 38 |
content = read_file(file, file_type)
|
| 39 |
+
|
| 40 |
# Check if content is not empty
|
| 41 |
if not content.strip():
|
| 42 |
return "Error: The document is empty or unsupported format.", None, None, None, None, None
|
| 43 |
+
|
| 44 |
# Summarize the content
|
| 45 |
try:
|
| 46 |
summary = summarizer(content, max_length=150, min_length=50, do_sample=False)
|
|
|
|
| 99 |
)
|
| 100 |
|
| 101 |
iface.launch()
|
| 102 |
+
|