KingNish commited on
Commit
a1bf1bb
·
verified ·
1 Parent(s): 8a16657

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -104,12 +104,12 @@ def split_content(content, chunk_size=32000):
104
 
105
  def chat_document(file, question):
106
  content = str(read_document(file))
107
- content = content.replace('\n', ' ')
108
- content = content.replace('\r', ' ')
109
- content = content.replace('\t', ' ')
110
- content = content.replace(' ', '')
111
- content = content.strip()
112
  if len(content) > 32000:
 
 
 
 
 
113
  content = content[:32000]
114
 
115
  # Define system prompt for the chat API
 
104
 
105
  def chat_document(file, question):
106
  content = str(read_document(file))
 
 
 
 
 
107
  if len(content) > 32000:
108
+ content = content.replace('\n', ' ')
109
+ content = content.replace('\r', ' ')
110
+ content = content.replace('\t', ' ')
111
+ content = content.replace(' ', '')
112
+ content = content.strip()
113
  content = content[:32000]
114
 
115
  # Define system prompt for the chat API