Spaces:
Runtime error
Runtime error
add stop number
Browse files
app.py
CHANGED
|
@@ -54,8 +54,17 @@ with col_2:
|
|
| 54 |
value=0,
|
| 55 |
step=1,
|
| 56 |
)
|
|
|
|
| 57 |
sample = sub_ds[index_sample]
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
st.markdown(markdown_text, unsafe_allow_html=True)
|
| 60 |
st.markdown(
|
| 61 |
"<h2 style='text-align: center'>Generation configuration</h2>",
|
|
|
|
| 54 |
value=0,
|
| 55 |
step=1,
|
| 56 |
)
|
| 57 |
+
|
| 58 |
sample = sub_ds[index_sample]
|
| 59 |
+
generation = sample["generation"]
|
| 60 |
+
stop_index_sample = st.number_input(
|
| 61 |
+
"Stop generation at character number",
|
| 62 |
+
min_value=0,
|
| 63 |
+
max_value=len(generation),
|
| 64 |
+
value=len(generation),
|
| 65 |
+
step=1,
|
| 66 |
+
)
|
| 67 |
+
markdown_text = generation_markup_format(safe_text(generation[:stop_index_sample]))
|
| 68 |
st.markdown(markdown_text, unsafe_allow_html=True)
|
| 69 |
st.markdown(
|
| 70 |
"<h2 style='text-align: center'>Generation configuration</h2>",
|