推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
SkywalkerJi
V2EX  ›  Python

现在 Python 的 ui 是不是都用 Gradio 了,还有更好的选择吗?

  •  1
     
  •   SkywalkerJi · Jun 5, 2024 · 9134 views
    This topic created in 887 days ago, the information mentioned may be changed or developed.
    看了 GitHub 上几个常见的 python ai 程序好像都是用的这个库。
    19 replies  •  2024-07-06 16:41:03 +08:00
    ZnductR0MjHvjRQ3
    ZnductR0MjHvjRQ3
    Jun 5, 2024❤️1
    1
    webui 的话 AI 应用最常见的是 Gradio
    jianchang512
    jianchang512
    Jun 5, 2024❤️1
    2
    ai 应用里想快速搭一个前端演示页面,Gradio 是最简单的,直接在 py 文件里写就行了,无需理会任何 js css 前端内容。
    对于不需要太复杂交互的 demo 之类,这个自然是最合适的了。
    supergeek1
    supergeek1
    Jun 5, 2024❤️1
    3
    同类的还有 streamlit
    vicalloy
    vicalloy
    Jun 5, 2024❤️3
    4
    Gradio 最简单,Streamlit 功能稍强一些。
    写简单的工具,优选 Gradio ,有功能实现不了再换 Streamlit ,还不行就手搓了。
    Davic1
    Davic1
    Jun 5, 2024❤️1
    5
    Conclusion:
    In summary, if you’re looking to quickly create simple web applications, especially for data visualization and dashboards, Streamlit might be a better choice. On the other hand, if your focus is on creating interfaces for machine learning models, Gradio provides a specialized and easy-to-use solution. The choice between the two depends on your specific use case and requirements.

    Quote from https://medium.com/@sujathamudadla1213/differences-between-streamlit-and-gradio-cf3ef123d0e1
    Sawyerhou
    Sawyerhou
    Jun 5, 2024
    7
    惊,原来现在做 ui 这么方便,感谢各位的分享。
    param
    param
    Jun 5, 2024 via Android
    8
    @Sawyerhou 哈哈哈哈
    kenvix
    kenvix
    Jun 5, 2024 via Android❤️1
    9
    主要是 demo 用途。Gradio 稍微想个性化一点就会变的极其难用。
    l8L12cwti87t9Kwg
    l8L12cwti87t9Kwg
    Jun 5, 2024
    10
    streamlit 现在用的人很多吧,特别是套 gpt 当聊天机器人
    noparking188
    noparking188
    Jun 5, 2024❤️1
    11
    Streamlit 挺不错的,而且提供免费的类似云上一键部署,分享分布很方便,不过如果复杂的前端展示和交互需求,建议就不要折腾了,很费解不讨好,直接前端写。
    我前端时间试了用 streamlit 写了个小 web 应用,哈哈,可以参考: https://navisearch.streamlit.app/
    ryanking8215
    ryanking8215
    Jun 5, 2024
    12
    有人用 nicegui 吗?
    qq78660651
    qq78660651
    Jun 5, 2024
    13
    streamlit 打包成 exe 稍微麻烦一点,这个 gradio 打包体验会不会好很多。
    如果可行,感觉接小兼职单,给脚本做一个 GUI 比较舒服;
    SkywalkerJi
    SkywalkerJi
    OP
    Jun 5, 2024
    14
    @noparking188 #11
    本地运行的 ai 程序如何结合前端有好的办法吗?
    让 python 的提供接口,然后部署一个 SPA 静态网页去请求 127.0.0.1 吗?
    kneo
    kneo
    Jun 5, 2024 via Android❤️1
    15
    @SkywalkerJi 谈不上好不好,只是几种方案。你怎么熟怎么来。

    你要是前端( react/vue )不熟你就 streamlit/gradio 。


    你要是前端栈比较熟,自己写功能丰富也可以很炫酷。后端调用 Python 服务,没问题。

    你要是不想写,可以找找现成的。如果你是 llm 应用,你就用 Python 实现一个 OpenAI 兼容的服务,然后现成的界面一大把。
    ClericPy
    ClericPy
    Jun 5, 2024
    16
    就日常用用的话,分好几个类型
    浏览器上 streamlit 、pywebio
    桌面 GUI pysimplegui ( 5.0 以后弃了。。。打算自己弄个)、pyside (开源的 pyqt )、tkinter 、kivy
    终端的 Fire 、typed ,还有个忘了叫啥了

    其他的名字一时半会想不起来,真的多面开花
    youthfire
    youthfire
    Jun 5, 2024 via iPhone❤️1
    17
    以前一直用 pysimplegui ,深度用了两年,设计很成熟,还捐助过,但写多窗口太费事了。streamlit 运行起来感觉有点慢,现在用类似的 pywebio ,轻巧速度快。没用过 Gradio 。不知道有没有用 pywebio 的 V 友对比过 Gradio 。
    flcwk
    flcwk
    Jun 10, 2024❤️1
    18
    我用 ttkbootstrap
    kxg3030
    kxg3030
    Jul 6, 2024
    19
    好用
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1754 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 50ms · UTC 16:04 · PVG 00:04 · LAX 08:04 · JFK 11:04
    ♥ Do have faith in what you're doing.