Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -77,7 +77,10 @@ def chat_document(file, question):
|
|
| 77 |
content = str(read_document(file))
|
| 78 |
if len(content) > 64000:
|
| 79 |
content = content[:64000]
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
# Define system prompt for the chat API
|
| 83 |
system_prompt = """
|
|
|
|
| 77 |
content = str(read_document(file))
|
| 78 |
if len(content) > 64000:
|
| 79 |
content = content[:64000]
|
| 80 |
+
content = content.replace('\n', ' ')
|
| 81 |
+
content = content.replace('\r', ' ')
|
| 82 |
+
content = content.replace('\t', ' ')
|
| 83 |
+
content = content.strip()
|
| 84 |
|
| 85 |
# Define system prompt for the chat API
|
| 86 |
system_prompt = """
|