Exemple #1
0
                                    state.jinja,
                                    state.reference,
                                    state.metadata,
                                    updated_answer_choices,
                                    updated_answer_choices_key,
                                )
                                # Update the state as well
                                state.template_name = updated_template_name
            #
            # Displays template output on current example if a template is selected
            # (in second column)
            #
            with col2:
                if state.template_name is not None:
                    st.empty()
                    template = dataset_templates[state.template_name]
                    prompt = template.apply(example)
                    if prompt == [""]:
                        st.write("∅∅∅ *Blank result*")
                    else:
                        st.write("Prompt + X")
                        show_text(prompt[0], width=40)
                        if len(prompt) > 1:
                            st.write("Y")
                            show_text(prompt[1], width=40)

#
# Must sync state at end
#
state.sync()