Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,7 +46,7 @@ def load_and_extract_text(file_path):
|
|
| 46 |
reader = csv.reader(f)
|
| 47 |
return '\n'.join(' '.join(row) for row in reader)
|
| 48 |
|
| 49 |
-
elif ext == 'txt'
|
| 50 |
with open(file_path, 'r', encoding='utf-8') as f:
|
| 51 |
return f.read()
|
| 52 |
|
|
@@ -61,7 +61,7 @@ def load_and_extract_text(file_path):
|
|
| 61 |
return f"Error processing file: {e}"
|
| 62 |
|
| 63 |
# File uploader
|
| 64 |
-
uploaded_file = st.file_uploader("Upload a document or image", type=["docx", "xlsx", "pdf", "csv", "txt", "pptx", "jpg", "jpeg", "png"
|
| 65 |
|
| 66 |
# Question input
|
| 67 |
question = st.text_input("💬 Enter your question:")
|
|
|
|
| 46 |
reader = csv.reader(f)
|
| 47 |
return '\n'.join(' '.join(row) for row in reader)
|
| 48 |
|
| 49 |
+
elif ext == 'txt':
|
| 50 |
with open(file_path, 'r', encoding='utf-8') as f:
|
| 51 |
return f.read()
|
| 52 |
|
|
|
|
| 61 |
return f"Error processing file: {e}"
|
| 62 |
|
| 63 |
# File uploader
|
| 64 |
+
uploaded_file = st.file_uploader("Upload a document or image", type=["docx", "xlsx", "pdf", "csv", "txt", "pptx", "jpg", "jpeg", "png"])
|
| 65 |
|
| 66 |
# Question input
|
| 67 |
question = st.text_input("💬 Enter your question:")
|