大模型接入Gradio实现本地化部署

               

         

        Terminator好用的一个终端

      

        Gradio官网地址  

        Gradio是一个用于快速创建交互式界面的Python库,这些界面可以用于演示和测试机器学习模型。使用Gradio,开发者可以非常轻松地为他们的模型构建一个前端界面,而不需要任何Web开发经验。

    

新建环境

conda create -n gradio python==3.8

conda activate gradio

pip install gradio -i https://mirror.baidu.com/pypi/simple/

安装完成

​​​​​​​大模型接入Gradio实现本地化部署_第1张图片

构建第一个演示:

你可以在你最喜欢的代码编辑器、Google Notebook、Google Colab或任何你编写Python的地方运行Gradio,编写你的第一个Gradio应用程序:

建一个app.py

import gradio as gr

def greet(name, intensity):
    return "Hello, " + name + "!" * int(intensity)

demo = gr.Interface(
    fn=greet,
    inputs=["text", "slider"],
    outputs=["text"],
)

demo.launch()

运行:

大模型接入Gradio实现本地化部署_第2张图片

未完...

你可能感兴趣的:(大模型,人工智能,语言模型)