ashhadahsan commited on
Commit
d49a5f8
·
1 Parent(s): 0753231

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -99,6 +99,8 @@ if st.button("Process",type="primary"):
99
  summary = []
100
 
101
  for x in stqdm(range(len(text))):
 
 
102
  try:
103
  summary.append(
104
  model(
@@ -143,7 +145,10 @@ if st.button("Process",type="primary"):
143
  model, tokenizer = load_t5()
144
  summary = []
145
  for x in stqdm(range(len(text))):
146
-
 
 
 
147
  tokens_input = tokenizer.encode(
148
  "summarize: " + text[x],
149
  return_tensors="pt",
@@ -199,6 +204,8 @@ if st.button("Process",type="primary"):
199
 
200
  summary = []
201
  for x in stqdm(range(len(text))):
 
 
202
  try:
203
  summary.append(model.predict(text[x])[0])
204
  except:
 
99
  summary = []
100
 
101
  for x in stqdm(range(len(text))):
102
+ if st.button("Cancel"):
103
+ break
104
  try:
105
  summary.append(
106
  model(
 
145
  model, tokenizer = load_t5()
146
  summary = []
147
  for x in stqdm(range(len(text))):
148
+ if st.button("Cancel"):
149
+ break
150
+
151
+
152
  tokens_input = tokenizer.encode(
153
  "summarize: " + text[x],
154
  return_tensors="pt",
 
204
 
205
  summary = []
206
  for x in stqdm(range(len(text))):
207
+ if st.button("Cancel"):
208
+ break
209
  try:
210
  summary.append(model.predict(text[x])[0])
211
  except: