技术栈

Gradio学习(一)—————启动一个demo页面

斯特凡今天也很帅2024-02-19 14:56

安装(Python 3.7以上版本)

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gradio

新建一个demo文件

import gradio as gr

def greet(name):

return "hello "+name+"!"

demo=gr.Interface(fn=greet,inputs="text",output="text")

因为在虚拟机中启动,而不是pycharm 所以指定主机ip (1.1.1.1)和端口号,如果是在pycharm 中,无需指定

demo.launch(server_name="1.1.1.1",server_port=7860,share=True,inbrowser=True)

上一篇:云原生容器化-5 Docker常见操作命令
下一篇:初次安装Android Studio卡在gradle的解决方法
相关推荐
金銀銅鐵
5 小时前
[Python] 从《千字文》中随机挑选汉字
后端·python
cup11
9 小时前
[技术复盘] Windows Python 打包实战:Nuitka 环境踩坑总结与 CI 自动化构建全指南
python·ai·环境变量·ci·nuitka·skill
aqi00
11 小时前
15天学会AI应用开发(七)有了大模型为什么还要引入RAG
人工智能·python·大模型·ai编程·ai应用
金銀銅鐵
13 小时前
用 Python 实现 Take-Away 游戏
python·游戏
copyer_xyf
14 小时前
Agent 流程编排
后端·python·agent
copyer_xyf
14 小时前
Agent RAG
后端·python·agent
copyer_xyf
14 小时前
【RAG】向量数据库:milvus
后端·python·agent
copyer_xyf
15 小时前
Agent 记忆管理
后端·python·agent
星云穿梭
1 天前
用Python写一个带图形界面的学生管理系统——完整教程
python
热门推荐
012026年6月AI行业全景:从百模大战到Agent元年,这30天发生了什么?022026年6月AI大模型全景报告:GPT-5.6、Claude Opus 4.8、Gemini 3.5,中美AI三足鼎立谁主沉浮?032026 年 AI 编程工具终极横评:Cursor vs Claude Code vs Copilot vs Windsurf04【AI】2026 年具身智能模型和世界模型总结05GitHub 镜像站点06AI科技热点日报 | 2026年6月1日07AI一周事件 · 2026-06-03 至 2026-06-09082026 AI 编程工具终极实战指南:Cursor vs Claude Code vs Copilot,开发者该怎么选?09Claude Code、Codex、Cursor三分天下:2026年AI编程Agent生态全景剖析10上线仅72小时被强制下架:Claude Fable 5 的短命