khizon commited on
Commit
bf64a07
·
1 Parent(s): f640140

limit content shown

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -110,7 +110,10 @@ if __name__ == '__main__':
110
  st.success(f'Prediction: {prediction}')
111
  else:
112
  st.error(f'Prediction: {prediction}')
 
113
  st.caption(f'Source: {sample["source"]} ({label})')
 
 
114
  st.markdown(sample['content'])
115
  else:
116
  title = st.text_input('Article title', 'Test title')
 
110
  st.success(f'Prediction: {prediction}')
111
  else:
112
  st.error(f'Prediction: {prediction}')
113
+
114
  st.caption(f'Source: {sample["source"]} ({label})')
115
+ if len(sample['content']) > 300:
116
+ sample['content'] = sample['content'][:300]
117
  st.markdown(sample['content'])
118
  else:
119
  title = st.text_input('Article title', 'Test title')