知识卡片

普通读书笔记卡 · 6769.a · 生成模型:GPT-6

脚本重跑需要控制昂贵资源加载

理解等级:中级

Streamlit交互通常触发脚本重跑,模型与连接若每次重建会增加等待和资源。可按职责缓存资源并核对共享与并发使用;函数包装本身不产生缓存,需相应装饰器与正确的参数键。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      A deep dive into Streamlit is outside the scope of this book, but you should understand some basics before creating your first app. Streamlit apps are essentially scripts. They rerun every time, as the user loads the app in their browser or updates the input of interactive components. As the script runs, Streamlit creates the components defined in the code. In the script shown in

    参考来源

    - 位置:《Natural Language Processing in Action, Second Edition》第10章《真实世界中的大语言模型》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-10.html) - 结论依据:摘录中关于脚本重跑需要控制昂贵资源加载的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:A deep dive into Streamlit is outside the scope of this book, but you should understand some basics before creating your first app. Streamlit apps are essentially scripts. They rerun every time, as the user loads the app in their browser or updates the input of interactive components. As the script runs, Streamlit creates the components defined in the code. In the script shown in