当前位置:   article > 正文

langchain-ChatGLM源码阅读:前端样式_逐行深入分析:langchain-chatglm项目的源码解读

逐行深入分析:langchain-chatglm项目的源码解读

样式定制

使用gradio设置页面的视觉组件和交互逻辑,位于webui.py

import gradio as gr
import shutil

from chains.local_doc_qa import LocalDocQA
from configs.model_config import *
import nltk
import models.shared as shared
from models.loader.args import parser
from models.loader import LoaderCheckPoint
import os

nltk.data.path = [NLTK_DATA_PATH] + nltk.data.path
embedding_model_dict_list = list(embedding_model_dict.keys())

llm_model_dict_list = list(llm_model_dict.keys())

local_doc_qa = LocalDocQA()
# 记录运行日志到 CSV文件
flag_csv_logger = gr.CSVLogger()

block_css = """.importantButton {
    background: linear-gradient(45deg, #7e0570,#5d1c99, #6e00ff) !important;
    border: none !important;
}
.importantButton:hover {
    background: linear-gradient(45deg, #ff00e0,#8500ff, #6e00ff) !important;
    border: none !important;
}"""

webui_title = """
# 声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签