Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 = [
|
87 |
-
|
88 |
st.session_state.titles = predicted_titles
|
89 |
|
90 |
# generate title button
|
91 |
-
st_generate_button = st.button('
|
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:
|