dan-vdb commited on
Commit
5e23aa5
·
1 Parent(s): 246399c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import streamlit as st
2
  import pandas as pd
3
  import numpy as np
 
4
 
5
  import torch
6
  from transformers import pipeline
@@ -36,4 +37,6 @@ with st.form("my_form"):
36
 
37
 
38
  if submitted:
39
- st.write(pipe(text, num_return_sequences=1, max_length=100)[0]["generated_text"])
 
 
 
1
  import streamlit as st
2
  import pandas as pd
3
  import numpy as np
4
+ import re
5
 
6
  import torch
7
  from transformers import pipeline
 
37
 
38
 
39
  if submitted:
40
+ text = pipe(text, num_return_sequences=1, max_length=200, repetition_penalty=2.0)[0]["generated_text"]
41
+ text = re.sub("( [A-Z])", r"\n\1", text)
42
+ st.write(text)