Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -234,7 +234,7 @@ def main():
|
|
234 |
progress_bar.progress(75)
|
235 |
|
236 |
import random
|
237 |
-
max_tweets =
|
238 |
if len(scored_docs) > max_tweets:
|
239 |
sampled_docs = random.sample(scored_docs, max_tweets)
|
240 |
st.info(f"Sampling {max_tweets} out of {len(scored_docs)} tweets for report generation")
|
@@ -279,7 +279,7 @@ Please ensure the report is complete and reaches approximately 800 words.
|
|
279 |
|
280 |
)
|
281 |
|
282 |
-
result = pipe(messages, max_new_tokens=
|
283 |
return result, None
|
284 |
|
285 |
except Exception as e:
|
@@ -308,7 +308,7 @@ Please ensure the report is complete and reaches approximately 800 words.
|
|
308 |
formatted_report = report.replace('\\n', '<br>')
|
309 |
|
310 |
# Display title separately with standard formatting
|
311 |
-
st.subheader("Generated Report
|
312 |
|
313 |
# Display the report content with normal styling
|
314 |
st.markdown(f"<div style='font-size: normal; font-weight: normal;'>{formatted_report}</div>", unsafe_allow_html=True)
|
|
|
234 |
progress_bar.progress(75)
|
235 |
|
236 |
import random
|
237 |
+
max_tweets = 500
|
238 |
if len(scored_docs) > max_tweets:
|
239 |
sampled_docs = random.sample(scored_docs, max_tweets)
|
240 |
st.info(f"Sampling {max_tweets} out of {len(scored_docs)} tweets for report generation")
|
|
|
279 |
|
280 |
)
|
281 |
|
282 |
+
result = pipe(messages, max_new_tokens=1024, repetition_penalty=1.2, do_sample=True, temperature=0.7, return_full_text=False)
|
283 |
return result, None
|
284 |
|
285 |
except Exception as e:
|
|
|
308 |
formatted_report = report.replace('\\n', '<br>')
|
309 |
|
310 |
# Display title separately with standard formatting
|
311 |
+
st.subheader("Generated Report:")
|
312 |
|
313 |
# Display the report content with normal styling
|
314 |
st.markdown(f"<div style='font-size: normal; font-weight: normal;'>{formatted_report}</div>", unsafe_allow_html=True)
|