记10,Gradio介绍

Gradio

Hugging Face:开源模型管理托管中心

https://www.gradio.app

官方文档:https://www.gradio.app/guides/quickstart

有图形化剂界面。也可以快速部署和分享:添加一个参数"share=True",就会产生一个公共的URL(72h后过期)

python 复制代码
import gradio as gr

def reverse_text(text):
     return text[::1]

# 接入的函数接口, 输入和输出(都是文本类型)
demo = gr.Interface(fun=reverse_text, input="text", output="text")

# 如果有2个返回类型,一个是文本一个是数字output=["text", "number"]。还可以添加标题,简短的描述,以及例子
# def reverse_text(text):
#      return text[::1], len(text)
# gr.Interface(fun=reverse_text, input="text", output=["text", "number"], title="这是标题", description="这是描述",example="[["123"], ["456"]])

# 启动应用
demo.launch(share="True")
相关推荐
曲幽2 小时前
FastAPI 身份验证总踩坑?这份 FastAPI Users “避坑指南”请收好
python·fastapi·web·jwt·oauth2·user·authentication
装不满的克莱因瓶3 小时前
掌握 RNN 与 LSTM 模型结构
人工智能·python·rnn·深度学习·神经网络·ai·lstm
何以解忧,唯有..3 小时前
Python包管理工具pip:从入门到精通
开发语言·python·pip
金銀銅鐵3 小时前
用 Tkinter 实现简单的猜数字游戏
后端·python
copyer_xyf3 小时前
Python 模块与包的导入导出
前端·后端·python
ice8130331814 小时前
【Python】Matplotlib折线图绘制
开发语言·python·matplotlib
copyer_xyf4 小时前
Python venv 虚拟环境
前端·后端·python
林爷万福5 小时前
GitHub 开源光谱数据处理项目推荐
python·光纤光谱仪
copyer_xyf5 小时前
Python 如何同时做很多事:进程、线程、协程
前端·后端·python
Full Stack Developme5 小时前
Spring Bean 依赖注入
python·spring·log4j