Spaces:
Sleeping
Sleeping
Update app.py
#1
by AsthanM - opened
app.py
CHANGED
|
@@ -13,7 +13,7 @@ def detect_encoding(file):
|
|
| 13 |
raw_data = file.read()
|
| 14 |
result = chardet.detect(raw_data)
|
| 15 |
encoding = result.get('encoding') or 'utf-8' # Default to UTF-8 if detection fails
|
| 16 |
-
file.seek(0)
|
| 17 |
return encoding
|
| 18 |
|
| 19 |
def extract_text(file, filename, encoding):
|
|
|
|
| 13 |
raw_data = file.read()
|
| 14 |
result = chardet.detect(raw_data)
|
| 15 |
encoding = result.get('encoding') or 'utf-8' # Default to UTF-8 if detection fails
|
| 16 |
+
file.seek(0)
|
| 17 |
return encoding
|
| 18 |
|
| 19 |
def extract_text(file, filename, encoding):
|