INNER CODE UNIT · Python

on_llm_new_token

ikatsov/tensor-house · supply-chain/control_center_llm/sc_control_center_app.py:74

            def on_llm_new_token(token: str) -> None:
                    full_content.append(token)
                    placeholder.markdown("".join(full_content) + "▌")

            st.session_state.processor.process(step['stage'], context, on_llm_new_token)

        content = "".join([x for x in full_content if x is not None])
        context.generated_outputs[step["stage"]] = content
        placeholder.markdown(format_content(step['caption'], content))

        st.session_state.messages.append({"role": step['role'], "caption": step['caption'], "content": content})

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…