【浦语开源】深入探索:大模型全链路开源组件 InternLM Lagent,打造灵笔Demo实战指南

一、准备工作:

1、环境配置:

pip、conda换源:

pip临时换源:

pip install -i https://mirrors.cernet.edu.cn/pypi/web/simple some-package

# 这里的“https://mirrors.cernet.edu.cn/pypi/web/simple”是所换的源,“some-package”是你需要安装的包

设置pip默认源,避免每次下载依赖包都要加上一长串的国内源

pip config set global.index-url https://mirrors.cernet.edu.cn/pypi/web/simple

conda换源:

镜像站提供了 Anaconda 仓库与第三方源(conda-forge、msys2、pytorch 等),各系统都可以通过修改用户目录下的
.condarc
文件来使用镜像站。

不同系统下的
.condarc
目录如下:

  • Linux
    :
    ${HOME}/.condarc
  • macOS
    :
    ${HOME}/.condarc
  • Windows
    :
    C:\Users\<YourUserName>\.condarc

注意:

  • Windows
    用户无法直接创建名为
    .condarc
    的文件,可先执行
    conda config --set show_channel_urls yes
    生成该文件之后再修改。
cat <<'EOF' > ~/.condarc
channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
EOF

更多详细内容可移步至
MirrorZ Help
查看

2、模型下载:

Huggingface:

使用 Hugging Face 官方提供的
huggingface-cli
命令行工具。安装依赖:

pip install -U huggingface_hub

安装好依赖包之后,执行以下代码:

import os
from huggingface_hub import hf_hub_download  # Load model directly 

# 下载模型
os.system('huggingface-cli download --resume-download internlm/internlm-chat-7b --local-dir your_path')

# resume-download:断点续下(断网也可继续下载)
# local-dir:本地存储路径。(linux 环境下需要填写绝对路径)

hf_hub_download(repo_id="internlm/internlm-7b", filename="config.json")

# repo_id: 模型的名称
# filename: 下载的文件名称

ModelScope:

安装依赖:

pip install modelscope==1.9.5
pip install transformers==4.35.2

安装完成后:

import torch
from modelscope import snapshot_download, AutoModel, AutoTokenizer
import os
model_dir = snapshot_download('Shanghai_AI_Laboratory/internlm-chat-7b', cache_dir='your path', revision='master')

# cache_dir:最好写成绝对路径

OpenXLAB:

安装依赖:

pip install -U openxlab

执行代码:

from openxlab.model import download
download(model_repo='OpenLMLab/InternLM-7b', model_name='InternLM-7b', output='your local path')

二、InternLM智能对话 Demo:

1、准备硬件设备:显卡

目前显卡比较短缺,各位大佬各显神通吧,这里以
InternStudio
为例

2、进入开发机配置环境:

进入
conda
环境之后,使用以下命令从本地克隆一个已有的
pytorch 2.0.1
的环境,运行时间可能比较长,耐心等待

bash # 请每次使用 jupyter lab 打开终端时务必先执行 bash 命令进入 bash 中
conda create --name internlm-demo --clone=/root/share/conda_envs/internlm-base

然后用下面命令激活虚拟环境,并安装所需环境:

conda activate internlm-demo


————————————————————————————demo所需的环境依赖
# 升级pip
python -m pip install --upgrade pip

pip install modelscope==1.9.5
pip install transformers==4.35.2
pip install streamlit==1.24.0
pip install sentencepiece==0.1.99
pip install accelerate==0.24.1

3、模型下载:

根据之前介绍的模型下载的三种方式都可以实现模型的下载,但是速度相对较慢,这里我使用的是
InternStudio
平台的
share
目录下已经为我们准备好的
InternLM
模型。

mkdir -p /root/model/Shanghai_AI_Laboratory
cp -r /root/share/temp/model_repos/internlm-chat-7b /root/model/Shanghai_AI_Laboratory

4、代码准备:


/root
路径下新建
code
目录,然后切换路径, clone 代码

cd /root/code
git clone https://gitee.com/internlm/InternLM.git


## 切换 commit 版本,可以让大家更好的复现
cd InternLM
git checkout 3028f07cb79e5b1d7342f4ad8d11efad3fd13d17


/root/code/InternLM/web_demo.py
中 29 行和 33 行的模型更换为本地的
/root/model/Shanghai_AI_Laboratory/internlm-chat-7b

5、运行:

(1)终端运行:


/root/code/InternLM
目录下新建一个
cli_demo.py
文件,将以下代码填入其中:

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM


model_name_or_path = "/root/model/Shanghai_AI_Laboratory/internlm-chat-7b"

tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name_or_path, trust_remote_code=True, torch_dtype=torch.bfloat16, device_map='auto')
model = model.eval()

system_prompt = """You are an AI assistant whose name is InternLM (书生·浦语).
- InternLM (书生·浦语) is a conversational language model that is developed by Shanghai AI Laboratory (上海人工智能实验室). It is designed to be helpful, honest, and harmless.
- InternLM (书生·浦语) can understand and communicate fluently in the language chosen by the user such as English and 中文.
"""

messages = [(system_prompt, '')]

print("=============Welcome to InternLM chatbot, type 'exit' to exit.=============")

while True:
    input_text = input("User  >>> ")
    input_text = input_text.replace(' ', '')
    if input_text == "exit":
        break
    response, history = model.chat(tokenizer, input_text, history=messages)
    messages.append((input_text, response))
    print(f"robot >>> {response}")

然后在终端运行:python /root/code/InternLM/cli_demo.py  即可

(2)web运行:

运行
/root/code/InternLM
目录下的
web_demo.py
文件,输入以下命令后,l利用SSH密钥将端口映射到本地。在本地浏览器输入
http://127.0.0.1:6006
即可。

bash
conda activate internlm-demo  # 首次进入 vscode 会默认是 base 环境,所以首先切换环境
cd /root/code/InternLM
streamlit run web_demo.py --server.address 127.0.0.1 --server.port 6006

三、Lagent智能工具demo调用:

1、环境准备:

Lagent所需环境和InternLM环境一直,若运行环境已经安装好依赖包可直接跳过:

# 升级pip
python -m pip install --upgrade pip

pip install modelscope==1.9.5
pip install transformers==4.35.2
pip install streamlit==1.24.0
pip install sentencepiece==0.1.99
pip install accelerate==0.24.1

2、模型下载:

Lagnet是智能体构建的工具,基础模型可以直接使用InterLM模型,无需重复下载。

3、代码准备:

切换路径到
/root/code
克隆
lagent
仓库,并通过
pip install -e .
源码安装
Lagent

cd /root/code
git clone https://gitee.com/internlm/lagent.git
cd /root/code/lagent
git checkout 511b03889010c4811b1701abb153e02b8e94fb5e # 尽量保证和教程commit版本一致
pip install -e . # 源码安装


/root/code/lagent/examples/react_web_demo.py
内容替换为以下代码:

import copy
import os

import streamlit as st
from streamlit.logger import get_logger

from lagent.actions import ActionExecutor, GoogleSearch, PythonInterpreter
from lagent.agents.react import ReAct
from lagent.llms import GPTAPI
from lagent.llms.huggingface import HFTransformerCasualLM


class SessionState:

    def init_state(self):
        """Initialize session state variables."""
        st.session_state['assistant'] = []
        st.session_state['user'] = []

        #action_list = [PythonInterpreter(), GoogleSearch()]
        action_list = [PythonInterpreter()]
        st.session_state['plugin_map'] = {
            action.name: action
            for action in action_list
        }
        st.session_state['model_map'] = {}
        st.session_state['model_selected'] = None
        st.session_state['plugin_actions'] = set()

    def clear_state(self):
        """Clear the existing session state."""
        st.session_state['assistant'] = []
        st.session_state['user'] = []
        st.session_state['model_selected'] = None
        if 'chatbot' in st.session_state:
            st.session_state['chatbot']._session_history = []


class StreamlitUI:

    def __init__(self, session_state: SessionState):
        self.init_streamlit()
        self.session_state = session_state

    def init_streamlit(self):
        """Initialize Streamlit's UI settings."""
        st.set_page_config(
            layout='wide',
            page_title='lagent-web',
            page_icon='./docs/imgs/lagent_icon.png')
        # st.header(':robot_face: :blue[Lagent] Web Demo ', divider='rainbow')
        st.sidebar.title('模型控制')

    def setup_sidebar(self):
        """Setup the sidebar for model and plugin selection."""
        model_name = st.sidebar.selectbox(
            '模型选择:', options=['gpt-3.5-turbo','internlm'])
        if model_name != st.session_state['model_selected']:
            model = self.init_model(model_name)
            self.session_state.clear_state()
            st.session_state['model_selected'] = model_name
            if 'chatbot' in st.session_state:
                del st.session_state['chatbot']
        else:
            model = st.session_state['model_map'][model_name]

        plugin_name = st.sidebar.multiselect(
            '插件选择',
            options=list(st.session_state['plugin_map'].keys()),
            default=[list(st.session_state['plugin_map'].keys())[0]],
        )

        plugin_action = [
            st.session_state['plugin_map'][name] for name in plugin_name
        ]
        if 'chatbot' in st.session_state:
            st.session_state['chatbot']._action_executor = ActionExecutor(
                actions=plugin_action)
        if st.sidebar.button('清空对话', key='clear'):
            self.session_state.clear_state()
        uploaded_file = st.sidebar.file_uploader(
            '上传文件', type=['png', 'jpg', 'jpeg', 'mp4', 'mp3', 'wav'])
        return model_name, model, plugin_action, uploaded_file

    def init_model(self, option):
        """Initialize the model based on the selected option."""
        if option not in st.session_state['model_map']:
            if option.startswith('gpt'):
                st.session_state['model_map'][option] = GPTAPI(
                    model_type=option)
            else:
                st.session_state['model_map'][option] = HFTransformerCasualLM(
                    '/root/model/Shanghai_AI_Laboratory/internlm-chat-7b')
        return st.session_state['model_map'][option]

    def initialize_chatbot(self, model, plugin_action):
        """Initialize the chatbot with the given model and plugin actions."""
        return ReAct(
            llm=model, action_executor=ActionExecutor(actions=plugin_action))

    def render_user(self, prompt: str):
        with st.chat_message('user'):
            st.markdown(prompt)

    def render_assistant(self, agent_return):
        with st.chat_message('assistant'):
            for action in agent_return.actions:
                if (action):
                    self.render_action(action)
            st.markdown(agent_return.response)

    def render_action(self, action):
        with st.expander(action.type, expanded=True):
            st.markdown(
                "<p style='text-align: left;display:flex;'> <span style='font-size:14px;font-weight:600;width:70px;text-align-last: justify;'>插    件</span><span style='width:14px;text-align:left;display:block;'>:</span><span style='flex:1;'>"  # noqa E501
                + action.type + '</span></p>',
                unsafe_allow_html=True)
            st.markdown(
                "<p style='text-align: left;display:flex;'> <span style='font-size:14px;font-weight:600;width:70px;text-align-last: justify;'>思考步骤</span><span style='width:14px;text-align:left;display:block;'>:</span><span style='flex:1;'>"  # noqa E501
                + action.thought + '</span></p>',
                unsafe_allow_html=True)
            if (isinstance(action.args, dict) and 'text' in action.args):
                st.markdown(
                    "<p style='text-align: left;display:flex;'><span style='font-size:14px;font-weight:600;width:70px;text-align-last: justify;'> 执行内容</span><span style='width:14px;text-align:left;display:block;'>:</span></p>",  # noqa E501
                    unsafe_allow_html=True)
                st.markdown(action.args['text'])
            self.render_action_results(action)

    def render_action_results(self, action):
        """Render the results of action, including text, images, videos, and
        audios."""
        if (isinstance(action.result, dict)):
            st.markdown(
                "<p style='text-align: left;display:flex;'><span style='font-size:14px;font-weight:600;width:70px;text-align-last: justify;'> 执行结果</span><span style='width:14px;text-align:left;display:block;'>:</span></p>",  # noqa E501
                unsafe_allow_html=True)
            if 'text' in action.result:
                st.markdown(
                    "<p style='text-align: left;'>" + action.result['text'] +
                    '</p>',
                    unsafe_allow_html=True)
            if 'image' in action.result:
                image_path = action.result['image']
                image_data = open(image_path, 'rb').read()
                st.image(image_data, caption='Generated Image')
            if 'video' in action.result:
                video_data = action.result['video']
                video_data = open(video_data, 'rb').read()
                st.video(video_data)
            if 'audio' in action.result:
                audio_data = action.result['audio']
                audio_data = open(audio_data, 'rb').read()
                st.audio(audio_data)


def main():
    logger = get_logger(__name__)
    # Initialize Streamlit UI and setup sidebar
    if 'ui' not in st.session_state:
        session_state = SessionState()
        session_state.init_state()
        st.session_state['ui'] = StreamlitUI(session_state)

    else:
        st.set_page_config(
            layout='wide',
            page_title='lagent-web',
            page_icon='./docs/imgs/lagent_icon.png')
        # st.header(':robot_face: :blue[Lagent] Web Demo ', divider='rainbow')
    model_name, model, plugin_action, uploaded_file = st.session_state[
        'ui'].setup_sidebar()

    # Initialize chatbot if it is not already initialized
    # or if the model has changed
    if 'chatbot' not in st.session_state or model != st.session_state[
            'chatbot']._llm:
        st.session_state['chatbot'] = st.session_state[
            'ui'].initialize_chatbot(model, plugin_action)

    for prompt, agent_return in zip(st.session_state['user'],
                                    st.session_state['assistant']):
        st.session_state['ui'].render_user(prompt)
        st.session_state['ui'].render_assistant(agent_return)
    # User input form at the bottom (this part will be at the bottom)
    # with st.form(key='my_form', clear_on_submit=True):

    if user_input := st.chat_input(''):
        st.session_state['ui'].render_user(user_input)
        st.session_state['user'].append(user_input)
        # Add file uploader to sidebar
        if uploaded_file:
            file_bytes = uploaded_file.read()
            file_type = uploaded_file.type
            if 'image' in file_type:
                st.image(file_bytes, caption='Uploaded Image')
            elif 'video' in file_type:
                st.video(file_bytes, caption='Uploaded Video')
            elif 'audio' in file_type:
                st.audio(file_bytes, caption='Uploaded Audio')
            # Save the file to a temporary location and get the path
            file_path = os.path.join(root_dir, uploaded_file.name)
            with open(file_path, 'wb') as tmpfile:
                tmpfile.write(file_bytes)
            st.write(f'File saved at: {file_path}')
            user_input = '我上传了一个图像,路径为: {file_path}. {user_input}'.format(
                file_path=file_path, user_input=user_input)
        agent_return = st.session_state['chatbot'].chat(user_input)
        st.session_state['assistant'].append(copy.deepcopy(agent_return))
        logger.info(agent_return.inner_steps)
        st.session_state['ui'].render_assistant(agent_return)


if __name__ == '__main__':
    root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    root_dir = os.path.join(root_dir, 'tmp_dir')
    os.makedirs(root_dir, exist_ok=True)
    main()

4、web demo运行:

同样,建立ssh远程连接,在浏览器输入
http://127.0.0.1:6006
即可。

streamlit run /root/code/lagent/examples/react_web_demo.py --server.address 127.0.0.1 --server.port 6006

确实厉害,连MBA的题目都能轻松应对。

四、浦语·灵笔图文理解创作 Demo:

1、基础配置:

和之前两个demo一样的流程,从环境配置到模型下载

# 进入 conda 环境之后,使用以下命令从本地克隆一个已有的pytorch 2.0.1 的环境
conda create --name xcomposer-demo --clone=/root/share/conda_envs/internlm-base


# 激活环境
conda activate xcomposer-demo



#安装依赖:
pip install transformers==4.33.1 
pip install timm==0.4.12 
pip install sentencepiece==0.1.99 
pip install gradio==3.44.4 
pip install markdown2==2.4.10 
pip install xlsxwriter==3.1.2 
pip install einops accelerate


# 模型下载:
mkdir -p /root/model/Shanghai_AI_Laboratory
cp -r /root/share/temp/model_repos/internlm-xcomposer-7b /root/model/Shanghai_AI_Laboratory

2、代码准备:

又是老朋友了

cd /root/code
git clone https://gitee.com/internlm/InternLM-XComposer.git
cd /root/code/InternLM-XComposer
git checkout 3e8c79051a1356b9c388a6447867355c0634932d  # 最好保证和教程的 commit 版本一致

3、运行web demo:

终端运行以下代码,同样是在完成ssh连接之后:

cd /root/code/InternLM-XComposer
python examples/web_demo.py  \
    --folder /root/model/Shanghai_AI_Laboratory/internlm-xcomposer-7b \
    --num_gpus 1 \
    --port 6006

num_gpus 指的是使用gpu的数量,vgpu-smi可以查看gpu的使用情况

五、SSH远程服务连接:

这里只是简单的介绍以下本次demo调用中使用的demo配置,具体可以看博客:
ssh用法及命令_ssh命令大全-CSDN博客

1、在本地机器上打开
Power Shell
终端。在终端中,运行以下命令来生成 SSH 密钥对:

ssh-keygen -t rsa

##-t表示类型选项,这里采用rsa加密算法

2、按
Enter
键接受默认值或输入自定义路径 ,默认情况下是在
~/.ssh/
目录中。(其中有一个提示是要求设置私钥口令passphrase,不设置则为空,这里看心情吧,如果不放心私钥的安全可以设置一下)执行结束以后会在
/home/当前用户 目录下
生成一个
.ssh 文件夹
,其中包含
私钥文件 id_rsa

公钥文件 id_rsa.pub

3、通过系统自带的
cat
工具查看文件内容:

cat ~\.ssh\id_rsa.pub
# ~ 是用户主目录的简写,.ssh 是SSH配置文件的默认存储目录,id_rsa.pub 是 SSH 公钥文件的默认名称。所以,cat ~\.ssh\id_rsa.pub 的意思是查看用户主目录下的 .ssh 目录中的 id_rsa.pub 文件的内容。

4、将公钥复制到剪贴板中,然后回到
InternStudio
控制台,点击配置 SSH Key。

在本

ssh -CNg -L 6006:127.0.0.1:6006 root@ssh.intern-ai.org.cn -p 33090

地终端输入以下指令
.6006
是在服务器中打开的端口,而
33090
是根据开发机的端口进行更改

注意:再这些操作中可能会出现多次warning,个人经验是只要没报错就继续运行。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/745101.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Qt实战项目——贪吃蛇

一、项目介绍 本项目是一个使用Qt框架开发的经典贪吃蛇游戏&#xff0c;旨在通过简单易懂的游戏机制和精美的用户界面&#xff0c;为玩家提供娱乐和编程学习的机会。 二、主要功能 2.1 游戏界面 游戏主要是由三个界面构成&#xff0c;分别是游戏大厅、难度选择和游戏内界面&a…

Studio One 6 Professional for Mac v6.6.1 音乐创作编辑软件 激活版

PreSonus Studio One 6 Professional 是一款功能强大的音乐制作软件&#xff0c;它为音乐创作者、制作人、录音师以及音乐爱好者提供了一个全面且易于使用的创作环境。从基本的音频录制到复杂的混音和母带处理&#xff0c;这款软件都能轻松应对&#xff0c;让音乐创作过程变得既…

『亚马逊云科技产品测评』程序员最值得拥有的第一台专属服务器 “亚马逊EC2实例“

授权声明&#xff1a;本篇文章授权活动官方亚马逊云科技文章转发、改写权&#xff0c;包括不限于在 Developer Centre, 知乎&#xff0c;自媒体平台&#xff0c;第三方开发者媒体等亚马逊云科技官方渠道 引言 自2006年8月9日&#xff0c;在搜索引擎大会&#xff08;SES San Jo…

基于jeecgboot-vue3的Flowable流程-自定义业务表单处理(二)-挂接自定义业务表单

因为这个项目license问题无法开源&#xff0c;更多技术支持与服务请加入我的知识星球。 1、增加一个根据服务名称动态寻找对应自定义表单组件的hooks import { ref, reactive, computed, markRaw, onMounted, defineAsyncComponent } from vue; import { listCustomForm } fro…

四川音盛佳云电子商务有限公司抖音电商的先行者

在当今数字时代&#xff0c;电商行业风起云涌&#xff0c;各大平台竞相争夺市场份额。而在这其中&#xff0c;四川音盛佳云电子商务有限公司以其独特的抖音电商服务模式&#xff0c;悄然崛起&#xff0c;成为了行业中的一股不可忽视的力量。今天&#xff0c;就让我们一起走进音…

坚持100天学习打卡Day1

1.大小端 2.引用的本质 及 深拷贝与浅拷贝 3.初始化列表方式 4.类对象作为类成员 5.静态成员 static

python - 运算符 / 条件语句 / 数字类型

一.运算符 >>> 5<3 False >>> 5<3 False >>> 5>3 True >>> 5>3 True >>> 53 False >>> 5!3 True 与操作and&#xff1a; >>> 5<3 and 2<4 False >>> 5>3 and 2<4 True 二…

基于SSM的医药垃圾分类管理系统

文章目录 项目介绍主要功能截图:部分代码展示设计总结项目获取方式🍅 作者主页:超级无敌暴龙战士塔塔开 🍅 简介:Java领域优质创作者🏆、 简历模板、学习资料、面试题库【关注我,都给你】 🍅文末获取源码联系🍅 项目介绍 基于SSM的医药垃圾分类管理系统,java项目…

信创好搭档,企业好选择| 亚信安慧AntDB诚邀您参与企业数智化升级云端研讨会

关于亚信安慧AntDB数据库 AntDB数据库始于2008年&#xff0c;在运营商的核心系统上&#xff0c;服务国内24个省市自治区的数亿用户&#xff0c;具备高性能、弹性扩展、高可靠等产品特性&#xff0c;峰值每秒可处理百万笔通信核心交易&#xff0c;保障系统持续稳定运行超十年&a…

目标检测系列(四)-利用pyqt5实现yolov8目标检测GUI界面

1、pyqt5安装 Qt Designer&#xff1a;一个用于创建图形用户界面的工具&#xff0c;可轻松构建复杂的用户界面。它基于MVC架构&#xff0c;可以将界面设计与逻辑分离&#xff0c;使得开发更为便捷。在Qt Designer中&#xff0c;可以通过拖拽控件来灵活地调整界面&#xff0c;并…

机器人自主学习方法学习

各类算法的优缺点 原理&#xff1a; 该结构中初始的知识为0&#xff0c;不存在任何先验知识&#xff0c;让机器人与环境交互不断获得经验&#xff0c;是一个增量学习的过程。 算法举例 基于强化学习的开源算法及工具 OpenAI Gym&#xff1a;用于开发和比较强化学习算法的工具…

HTML5五十六个民族网站模板源码

文章目录 1.设计来源高山族1.1 登录界面演示1.2 注册界面演示1.3 首页界面演示1.4 中国民族界面演示1.5 关于高山族界面演示1.6 联系我们界面演示 2.效果和源码2.1 动态效果2.2 源代码2.3 源码目录 源码下载 作者&#xff1a;xcLeigh 文章地址&#xff1a;https://blog.csdn.ne…

《Redis设计与实现》阅读总结-2

第 7 章 压缩列表 1. 概念&#xff1a; 压缩列表是列表键和哈希键的底层实现之一。当一个列表键只包含少量列表项&#xff0c;并且每个列表项是小整数值或长度比较短的字符串&#xff0c;那么Redis就会使用压缩类别来做列表键的底层实现。哈希键里面包含的所有键和值都是最小…

TEC相关专利研究

每天一篇行业发展资讯&#xff0c;让大家更及时了解外面的世界。 更多资讯&#xff0c;请关注B站/公众号【莱歌数字】&#xff0c;有视频教程~~ 关于TEC在电子行业的部署有很多讨论&#xff0c;这些专利显示了不同发明者关注的一些显著特征。下面的表1列出了本期将审查的专利…

【动态内存】详解

Hi~&#xff01;这里是奋斗的小羊&#xff0c;很荣幸您能阅读我的文章&#xff0c;诚请评论指点&#xff0c;欢迎欢迎 ~~ &#x1f4a5;&#x1f4a5;个人主页&#xff1a;奋斗的小羊 &#x1f4a5;&#x1f4a5;所属专栏&#xff1a;C语言 &#x1f680;本系列文章为个人学习…

AI实战案例!如何运用SD完成运营设计海报?玩转Stable Diffusion必知的3大绝技

大家好我是安琪&#xff01; Satble Diffusion 给视觉设计带来了前所未有的可能性和机会&#xff0c;它为设计师提供了更多选择和工具的同时&#xff0c;也改变了设计师的角色和设计流程。然而&#xff0c;设计师与人工智能软件的协作和创新能力仍然是不可或缺的。接下来我将从…

Java 中 String 类

目录 1 常用方法 1.1 字符串构造 1.2 字符串包含的成员 1.3 String 对象的比较 1.4 字符串查找 1.5 转化 1.5.1 数值和字符串转化 1.5.2 大小写转化 1.5.3 字符串转数组 1.5.4 格式化 1.6 字符串替换 1.7 字符串拆分 1.8 字符串截取 1.9 其他操作方法 1.10 字符…

DDR3控制器(一)DDR3 IP调用

目录 一、DDR3 IP核简介 二、DDR3 IP核调用 在千兆以太网通信中用到了DDR3控制器&#xff0c;但是并没有对其做相关介绍。这次准备重新整理一下DDR3控制相关知识&#xff0c;复习巩固一下。 一、DDR3 IP核简介 MIG IP核&#xff08;Memory Interface Generator&#xff09;是…

SiLM585x系列SiLM5851NHCG-DG一款具有分离的管脚输出 单通道隔离驱动器 拥有强劲的驱动能力

SiLM585x系列SiLM5851NHCG-DG是一款单通道隔离驱动器&#xff0c;具有分离的管脚输出&#xff0c;提供3.0A源电流和6.0A灌电流。主动保护功能包括退饱和过流检测、UVLO、隔离故障报警和 2.5A 米勒钳位。输入侧电源的工作电压为3V至5.5V&#xff0c;输出侧电源的工作电压范围为1…

计算机毕业设计Thinkphp/Laravel学生考勤管理系统zyoqy

管理员登录学生考勤管理系统后&#xff0c;可以对首页、个人中心、公告信息管理、年级管理、专业管理、班级管理、学生管理、教师管理、课程信息管理、学生选课管理、课程签到管理、请假申请管理、销假申请管理等功能进行相应操作&#xff0c;如图5-2所示。学生登录进入学生考勤…