Yashvj123 commited on
Commit
7138883
·
verified ·
1 Parent(s): d7f19e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -14
app.py CHANGED
@@ -21,21 +21,20 @@ st.set_page_config(
21
  page_icon="💊"
22
  )
23
 
24
-
25
  # Split large response into smaller chunks (for translation)
26
- def split_text_into_chunks(text, max_length=450):
27
- lines = text.split('\n')
28
- chunks = []
29
- current = ""
30
- for line in lines:
31
- if len(current) + len(line) + 1 <= max_length:
32
- current += line + '\n'
33
- else:
34
- chunks.append(current.strip())
35
- current = line + '\n'
36
- if current:
37
- chunks.append(current.strip())
38
- return chunks
39
 
40
  # Save text to image
41
  def save_text_as_image(text, file_path):
 
21
  page_icon="💊"
22
  )
23
 
 
24
  # Split large response into smaller chunks (for translation)
25
+ # def split_text_into_chunks(text, max_length=450):
26
+ # lines = text.split('\n')
27
+ # chunks = []
28
+ # current = ""
29
+ # for line in lines:
30
+ # if len(current) + len(line) + 1 <= max_length:
31
+ # current += line + '\n'
32
+ # else:
33
+ # chunks.append(current.strip())
34
+ # current = line + '\n'
35
+ # if current:
36
+ # chunks.append(current.strip())
37
+ # return chunks
38
 
39
  # Save text to image
40
  def save_text_as_image(text, file_path):