Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
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):
|