Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -127,16 +127,12 @@ if button:
|
|
127 |
# Split the text by whitespace
|
128 |
words = full_text.split()
|
129 |
# For instance, show only the first 40 words
|
130 |
-
preview_word_count =
|
131 |
# Create the short preview and the remainder
|
132 |
preview_text = " ".join(words[:preview_word_count])
|
133 |
remainder_text = " ".join(words[preview_word_count:])
|
134 |
# Always display the preview_text
|
135 |
st.write(preview_text + ("..." if remainder_text else ""))
|
136 |
-
# If there's more content, put it inside an expander
|
137 |
-
if remainder_text:
|
138 |
-
with st.expander("Read more"):
|
139 |
-
st.write(remainder_text)
|
140 |
# ------- Additional info below the text -------
|
141 |
metadata = res.payload.get('metadata', {})
|
142 |
countries = metadata.get('countries', "[]")
|
@@ -182,10 +178,6 @@ if button:
|
|
182 |
remainder_text = " ".join(words[preview_word_count:])
|
183 |
# Always display the preview_text
|
184 |
st.write(preview_text + ("..." if remainder_text else ""))
|
185 |
-
# If there's more content, put it inside an expander
|
186 |
-
if remainder_text:
|
187 |
-
with st.expander("Read more"):
|
188 |
-
st.write(remainder_text)
|
189 |
# Additional text below the content
|
190 |
metadata = res.payload.get('metadata', {})
|
191 |
countries = metadata.get('countries', "[]")
|
|
|
127 |
# Split the text by whitespace
|
128 |
words = full_text.split()
|
129 |
# For instance, show only the first 40 words
|
130 |
+
preview_word_count = 120
|
131 |
# Create the short preview and the remainder
|
132 |
preview_text = " ".join(words[:preview_word_count])
|
133 |
remainder_text = " ".join(words[preview_word_count:])
|
134 |
# Always display the preview_text
|
135 |
st.write(preview_text + ("..." if remainder_text else ""))
|
|
|
|
|
|
|
|
|
136 |
# ------- Additional info below the text -------
|
137 |
metadata = res.payload.get('metadata', {})
|
138 |
countries = metadata.get('countries', "[]")
|
|
|
178 |
remainder_text = " ".join(words[preview_word_count:])
|
179 |
# Always display the preview_text
|
180 |
st.write(preview_text + ("..." if remainder_text else ""))
|
|
|
|
|
|
|
|
|
181 |
# Additional text below the content
|
182 |
metadata = res.payload.get('metadata', {})
|
183 |
countries = metadata.get('countries', "[]")
|