craigchen commited on
Commit
25cb490
·
1 Parent(s): ba216d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -83,12 +83,12 @@ def generate_title():
83
  # compute predictions
84
  outputs = model.generate(**inputs, do_sample=True, temperature=temperature)
85
  decoded_outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True)
86
- predicted_titles = [nltk.sent_tokenize(decoded_output.strip())[0] for decoded_output in decoded_outputs]
87
-
88
  st.session_state.titles = predicted_titles
89
 
90
  # generate title button
91
- st_generate_button = st.button('Generate query', on_click=generate_title)
92
 
93
  # title generation labels
94
  if 'titles' not in st.session_state:
 
83
  # compute predictions
84
  outputs = model.generate(**inputs, do_sample=True, temperature=temperature)
85
  decoded_outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True)
86
+ predicted_titles = [decoded_output[0] for decoded_output in decoded_outputs]
87
+
88
  st.session_state.titles = predicted_titles
89
 
90
  # generate title button
91
+ st_generate_button = st.button('生成query', on_click=generate_title)
92
 
93
  # title generation labels
94
  if 'titles' not in st.session_state: