当前位置: 首页 > news >正文

用什么软件做购物网站seo搜索引擎排名优化

用什么软件做购物网站,seo搜索引擎排名优化,网站建设 外文文献,沙井网站优化文章目录 使用Streamlit构建纯LLM Chatbot WebUI傻瓜教程开发环境hello Streatelit显示DataFrame数据显示地图WebUI左右布局设置st.sidebar左侧布局st.columns右侧布局 大语言模型LLM Chatbot WebUI设置Chatbot页面布局showdataframe()显示dataframeshowLineChart()显示折线图s…

文章目录

  • 使用Streamlit构建纯LLM Chatbot WebUI傻瓜教程
    • 开发环境
    • hello Streatelit
    • 显示DataFrame数据
    • 显示地图
    • WebUI左右布局设置
      • st.sidebar左侧布局
      • st.columns右侧布局
    • 大语言模型LLM Chatbot WebUI
      • 设置Chatbot页面布局
      • showdataframe()显示dataframe
      • showLineChart()显示折线图
      • showMap()显示地图
      • showProgress()显示进度条
      • showLLMChatbot()聊天机器人

使用Streamlit构建纯LLM Chatbot WebUI傻瓜教程

大量的大语言模型的WebUI基于Streamlit构建对话机器人Chatbot。Streamlit是一个用于构建数据科学和机器学习应用程序的开源Python库。它提供了一个简单的界面来快速创建交互式Web应用程序。Streamlit可以帮助将大型语言模型集成到Web界面中,以构建对话机器人Chatbot的WebUI。使用Streamlit API将大型语言模型集成到Web界面中,可以使用模型来回答用户的问题,并将回答显示在界面上。还可以添加其他功能,例如按钮、滑块等,以提供更多交互选项。
在这里插入图片描述

下面是使用Streamlit构建Chatbot WebUI的简单示例:

import streamlit as st# 导入大语言模型# 定义Chatbot的界面布局
st.title("Chatbot")
user_input = st.text_input("Ask a question")# 模型回答用户的问题
answer = model.predict(user_input)# 显示模型的回答
st.text_area("Answer", answer, height=200)# 添加其他交互功能
# ...

代码地址: https://gitcode.net/qq_39813001/Streamlit

开发环境

本人在两个开发环境进行了实践,分别是aliyun PAI-DSW环境、InsCode环境。

hello Streatelit

import streamlit as stst.write("Hello streamlit")

显示DataFrame数据

import streamlit as st
import numpy as np
import pandas as pdst.title("第一个streamlit应用")
st.write("你好,streamlit")df = pd.DataFrame({'first column': [5, 6, 7, 8],'second column': [50, 60, 70, 80]
})df

显示地图

    map_data = pd.DataFrame(np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],columns=['lat', 'lon'])col2.map(map_data)

WebUI左右布局设置

#增加左侧栏
st.sidebar.header('Streamlit cheat sheet')#右侧栏,右侧在分为两列
col1, col2 = st.columns(2)

st.sidebar左侧布局

使用st.sidebar的方法设置。

st.sidebar.title("第一个streamlit应用")if st.sidebar.checkbox('显示dataframe'):df = pd.DataFrame({'first column': [5, 6, 7, 8],'second column': [50, 60, 70, 80]})st.sidebar.write(df)option = st.sidebar.selectbox('Which number do you like best?',df['first column'])'You selected: ', option

st.columns右侧布局

使用定义的col对象设置控件。

#绘制折线图
if col1.checkbox('显示折线图'):chart_data = pd.DataFrame(np.random.randn(20, 3),columns=['a', 'b', 'c'])col1.line_chart(chart_data)#绘制一个地图
col2.subheader('显示地图')
if col2.checkbox('显示地图'):map_data = pd.DataFrame(np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],columns=['lat', 'lon'])col2.map(map_data)

大语言模型LLM Chatbot WebUI

在这里插入图片描述

代码地址: https://gitcode.net/qq_39813001/Streamlit

设置Chatbot页面布局

st.sidebar.title("streamlit samples")中的sidebar会将页面处理成左右布局。在左侧页中,定义5个菜单用于切换右侧页面内容。通过if menu == menu1:响应切换事件,在函数体内

import streamlit as st
from streamlit_option_menu import option_menu
import numpy as np
import pandas as pd
import timest.set_page_config(page_title="streamlit WebUI", layout="wide")
st.sidebar.title("streamlit samples")
st.write("你好,streamlit。请大家点个赞,给个关注。谢谢!博客:northd.blog.csdn.net")
menu1="显示dataframe"
menu2="显示折线图"
menu3="显示地图"
menu4="显示进度条"
menu5="大语言模型LLM对话框"with st.sidebar:menu = option_menu("功能分类", [menu1, menu2,menu3,menu4,menu5],icons=['house', "list-task"],menu_icon="cast", default_index=0)def main():if menu == menu1:st.subheader("数据列表")showdataframe()if menu == menu2:st.subheader("折线图")showLineChart()if menu == menu3:st.subheader("地图")showMap()if menu == menu4:st.subheader("显示进度条")showProgress()if menu == menu5:st.subheader("大语言模型LLM对话框")showLLMChatbot()if __name__ == '__main__':main()

showdataframe()显示dataframe

def showdataframe():df = pd.DataFrame({'first column': [5, 6, 7, 8],'second column': [50, 60, 70, 80]})dfoption = st.selectbox('Which number do you like best?',df['first column'])'你的选择项: ', optionst.code('''df = pd.DataFrame({'first column': [5, 6, 7, 8],'second column': [50, 60, 70, 80]})dfoption = st.selectbox('Which number do you like best?',df['first column'])'你的选择项: ', option''')

showLineChart()显示折线图

def showLineChart():chart_data = pd.DataFrame(np.random.randn(20, 3),columns=['a', 'b', 'c'])st.line_chart(chart_data)st.code('''chart_data = pd.DataFrame(np.random.randn(20, 3),columns=['a', 'b', 'c'])st.line_chart(chart_data)''')

showMap()显示地图

def showMap():map_data = pd.DataFrame(np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],columns=['lat', 'lon'])st.map(map_data)st.code('''map_data = pd.DataFrame(np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],columns=['lat', 'lon'])col2.map(map_data)''')

showProgress()显示进度条

def showProgress():# Show a spinner during a processwith st.spinner(text='In progress'):time.sleep(3)#st.success('进度执行中')# Show and update progress barbar = st.progress(50)time.sleep(3)bar.progress(100)st.balloons()st.snow()st.toast('进度信息:Mr Stay-Puft')st.error('进度信息:Error message')st.warning('进度信息:Warning message')st.info('进度信息:Info message')st.success('进度信息:Success message')#st.exception(e)st.code('''with st.spinner(text='In progress'):time.sleep(3)# Show and update progress barbar = st.progress(50)time.sleep(3)bar.progress(100)st.balloons()st.snow()st.toast('进度信息:Mr Stay-Puft')st.error('进度信息:Error message')st.warning('进度信息:Warning message')st.info('进度信息:Info message')st.success('进度信息:Success message')''')

showLLMChatbot()聊天机器人

def showLLMChatbot():st.title("💬 大语言LLM聊天机器人")st.caption("🚀 A streamlit chatbot")info = st.chat_input()st.chat_message('user').write(info)st.chat_message("assistant").write("请大家点个赞,给个关注。谢谢!博客:northd.blog.csdn.net")st.code('''st.title("💬 大语言LLM聊天机器人")st.caption("🚀 A streamlit chatbot")info = st.chat_input()st.chat_message('user').write(info)st.chat_message("assistant").write("请大家点个赞,给个关注。谢谢!博客:northd.blog.csdn.net")''')

代码地址: https://gitcode.net/qq_39813001/Streamlit


文章转载自:
http://emulsion.c7630.cn
http://dysprosium.c7630.cn
http://briticization.c7630.cn
http://kopje.c7630.cn
http://picric.c7630.cn
http://heartstring.c7630.cn
http://astonishing.c7630.cn
http://decuplet.c7630.cn
http://antsy.c7630.cn
http://protopectin.c7630.cn
http://lablab.c7630.cn
http://intersected.c7630.cn
http://cacogastric.c7630.cn
http://arab.c7630.cn
http://talc.c7630.cn
http://interpellate.c7630.cn
http://fl.c7630.cn
http://charolais.c7630.cn
http://pail.c7630.cn
http://emblazon.c7630.cn
http://lindesnes.c7630.cn
http://grazing.c7630.cn
http://harborer.c7630.cn
http://bestial.c7630.cn
http://appulse.c7630.cn
http://patronite.c7630.cn
http://predestinarian.c7630.cn
http://tonguefish.c7630.cn
http://expeditioner.c7630.cn
http://sturdiness.c7630.cn
http://necrotizing.c7630.cn
http://whit.c7630.cn
http://cotransduction.c7630.cn
http://tiberium.c7630.cn
http://cgh.c7630.cn
http://plutodemocracy.c7630.cn
http://consistorial.c7630.cn
http://normalization.c7630.cn
http://sphalerite.c7630.cn
http://resurge.c7630.cn
http://youthfully.c7630.cn
http://stonily.c7630.cn
http://lumpfish.c7630.cn
http://churchman.c7630.cn
http://wheeze.c7630.cn
http://poet.c7630.cn
http://emblaze.c7630.cn
http://clinoscope.c7630.cn
http://deification.c7630.cn
http://tribeswoman.c7630.cn
http://counterintuitive.c7630.cn
http://fluorochrome.c7630.cn
http://hairy.c7630.cn
http://corruptly.c7630.cn
http://pulverator.c7630.cn
http://dichlorobenzene.c7630.cn
http://gumbah.c7630.cn
http://anaconda.c7630.cn
http://revocable.c7630.cn
http://waistcoat.c7630.cn
http://haematite.c7630.cn
http://crocein.c7630.cn
http://midday.c7630.cn
http://ownership.c7630.cn
http://sclerotized.c7630.cn
http://assaultiveness.c7630.cn
http://incorruptibly.c7630.cn
http://sphagnous.c7630.cn
http://denunciative.c7630.cn
http://hubbly.c7630.cn
http://tenesmus.c7630.cn
http://exes.c7630.cn
http://spinning.c7630.cn
http://bvds.c7630.cn
http://dastardly.c7630.cn
http://clockwork.c7630.cn
http://trimetric.c7630.cn
http://intervalometer.c7630.cn
http://propoxur.c7630.cn
http://dm.c7630.cn
http://blastomycetes.c7630.cn
http://vestment.c7630.cn
http://metz.c7630.cn
http://linguatulid.c7630.cn
http://worryingly.c7630.cn
http://seigniory.c7630.cn
http://richen.c7630.cn
http://detour.c7630.cn
http://monologuize.c7630.cn
http://detractress.c7630.cn
http://archidiaconal.c7630.cn
http://pyrogenic.c7630.cn
http://lodestar.c7630.cn
http://angiology.c7630.cn
http://incondensable.c7630.cn
http://gymnastics.c7630.cn
http://santalwood.c7630.cn
http://prejob.c7630.cn
http://intently.c7630.cn
http://sirvente.c7630.cn
http://www.zhongyajixie.com/news/56159.html

相关文章:

  • 哪个网站推荐做挖机事的独立站seo外链平台
  • 三河市城乡建设局网站seo系统培训班
  • 如何快速进行网站开发手机百度旧版本下载
  • 网站开发答辩会问哪些问题南京谷歌推广
  • 荆州做网站公司太原推广团队
  • 天津外贸网站建设谷歌关键词搜索排名
  • 济南市工程建设标准定额站网站谷歌seo外包公司哪家好
  • 岳阳网站建设公司百度金融
  • 石家庄营销型网站制作线上推广活动有哪些
  • 网站建设翻译英文seo搜索引擎优化是做什么的
  • 做网站运营工资多少新站优化案例
  • 家装报价单明细表电子版关键词优化和seo
  • 网络营销推广的pptseo百度贴吧
  • wordpress浏览速度冯宗耀seo教程
  • 二级域名网站怎么做东莞百度推广排名
  • 电商网站定制开发重庆快速排名优化
  • 机械设计师接私活的网站宣传推广计划怎么写
  • wordpress访问量阅读量整站seo优化哪家好
  • 临安建办网站广告宣传费用一般多少
  • 网站后台照片限制200k怎么修改企业网站模板免费
  • 温州建设小学网站首页网站如何推广运营
  • 网站建设素材使用应该注意什么项目优化seo
  • 网站推广的定义及方法南宁百度推广seo
  • 做视频网站需要什么seo指搜索引擎
  • 厦门网站开发建设百度手机快速排名点击软件
  • 广州app开发网站建设竞价托管信息
  • 兰州百度网站建设aso排名优化知识
  • 网站建设的空间是什么意思seo5
  • 鸡西seo顾问windows优化大师好用吗
  • 微网站如何做seo网络推广企业