LLM系列 | 22 : Code Llama实战(下篇):本地部署、量化及GPT-4对比

news2024/9/23 5:31:49
  • 引言

  • 模型简介

  • 依赖安装

  • 模型inference

    • 代码补全

    • 4-bit版模型

    • 代码填充

    • 指令编码

  • Code Llama vs ChatGPT vs GPT4

  • 小结

引言

青山隐隐水迢迢,秋尽江南草未凋。

小伙伴们好,我是《小窗幽记机器学习》的小编:卖热干面的小女孩。紧接前文:

今天这篇小作文作为代码大语言模型Code Llama的下篇,主要介绍如何在本地部署Code Llama,同时介绍如何对Code Llama做模型量化。最后,对比Code Llama、ChatGPT和GTP4这三者的代码生成效果。

模型简介

官方发布了3类Code Llama模型,每类都有三种模型尺寸:

  • Code Llama:Base模型(即常说的基座模型),为通用的代码生成和理解而设计。

  • Code Llama - Python:专门为Python而设计。

  • Code Llama - Instruct:遵循指令,更加安全,可以作为代码助手。

三者关系如下:

依赖安装

pip3 install git+https://github.com/huggingface/transformers.git@main accelerate -i https://mirrors.cloud.tencent.com/pypi/simple

transformers版本:Version: 4.33.0.dev0

本文以下实验代码的获取,请前往《小窗幽记机器学习》找小编获取。

模型inference

代码补全

测试代码补齐功能的代码如下:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/9/4 20:07
# @Author  : 卖秋裤的小女孩
# @File    : inference_code_llama_hf.py
# @联系方式  : 微信公众号<小窗幽记机器学习>

from transformers import AutoTokenizer
import transformers
import torch
"""
测试代码补全能力
"""
model_path = "/home/model_zoo/LLM/llama2/CodeLlama-34b-Python-hf/"
tokenizer = AutoTokenizer.from_pretrained(model_path)
pipeline = transformers.pipeline(
    "text-generation",
    model=model_path,
    torch_dtype=torch.float16,
    device_map="auto",
)

sequences = pipeline(
    'def fibonacci(',
    do_sample=True,
    temperature=0.2,
    top_p=0.9,
    num_return_sequences=1,
    eos_token_id=tokenizer.eos_token_id,
    max_length=512,
)
for seq in sequences:
    print(f"Result: {seq['generated_text']}")

以上使用34B的模型做代码补齐能力测试,如果将模型置于一张A100(40G)上做inference,显存基本打满:

经过「漫长」的等待,终于「输出结果:」

Result: def fibonacci(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibonacci(n-1) + fibonacci(n-2)


def fibonacci_iterative(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        a = 0
        b = 1
        for i in range(2, n+1):
            c = a + b
            a = b
            b = c
        return b


def fibonacci_iterative_2(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        a = 0
        b = 1
        for i in range(2, n+1):
            c = a + b
            a = b
            b = c
        return c


def fibonacci_iterative_3(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        a = 0
        b = 1
        for i in range(2, n+1):
            c = a + b
            a = b
            b = c
        return a


def fibonacci_iterative_4(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        a = 0
        b = 1
        for i in range(2, n+1):
            c = a + b
            a = b
            b = c
        return a


def fibonacci_iterative_5(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        a = 0
        b = 1
        for i in range(2, n+1):
            c = a + b
            a = b
            b = c
        return a

如果用2张A100(40G)加载模型做inference,能够相对较快返回结果。所以,对于34B版模型,建议先做量化,再用多块A100的做inference。

4-bit版模型

Transformers中已集成Code Llama,因此可以直接使用Transformers加载4-bit模型。这使得在消费级的nvidia 3090卡上运行大型的32B参数模型变得可能!以下演示如何在4-bit模式下进行推理的方法:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/9/4 21:01
# @Author  : 卖秋裤的小女孩
# @联系方式  : 微信公众号<小窗幽记机器学习>
# @File    : inference_code_llama_34B_4bit.py

from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
import torch

model_id = "/home/model_zoo/LLM/llama2/CodeLlama-34b-Python-hf/"
# model_id = "codellama/CodeLlama-34b-hf"
quantization_config = BitsAndBytesConfig(
   load_in_4bit=True,
   bnb_4bit_compute_dtype=torch.float16
)

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    quantization_config=quantization_config,
    device_map="auto",
)

prompt = 'def remove_non_ascii(s: str) -> str:\n    """ '
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")

output = model.generate(
    inputs["input_ids"],
    max_new_tokens=512,
    do_sample=True,
    top_p=0.9,
    temperature=0.1,
)
output = output[0].to("cpu")
print(tokenizer.decode(output))

inference期间显卡占用情况:

「输出结果如下:」

<s> def remove_non_ascii(s: str) -> str:
    """
    Remove non-ascii characters from a string
    """
    return "".join(c for c in s if ord(c) < 128)


def clean_string(s: str) -> str:
    """
    Clean a string by removing non-ascii characters and then removing
    any extra whitespace
    """
    s = remove_non_ascii(s)
    s = s.strip()
    return s
</s>

鉴于inference速度问题,后续试验选用7B大小的模型。

代码填充

这是一个针对代码模型的特殊任务。在该任务下,模型为现有前缀和后缀的代码(包括注释)生成最佳匹配的代码。这是代码助手通常使用的策略:根据出现在光标前后的内容,填充当前的光标位置的内容。这个任务只能在「7B和13B模型的基座模型和指令微调模型」中使用。代码填充任务「不适用于34B版模型或Python版模型」。如果想要使用代码填充功能,需要注意训练模型的格式,因为它使用特殊的分隔符来识别提示的不同部分。可以直接使用transformers的CodeLlamaTokenizer。在底层,tokenizer会自动通过<FILL_ME>进行分割,以创建一个符合原始训练模式的格式化输入字符串。具体代码如下:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/9/4 19:25
# @Author  : 卖秋裤的小女孩
# @联系方式  : 微信公众号<小窗幽记机器学习>
# @File    : inference_code_infilling_hf.py

from transformers import AutoTokenizer, AutoModelForCausalLM, AutoConfig
import torch

# model_id = "/home/model_zoo/LLM/llama2/CodeLlama-7b-Python-hf"  # 代码填充任务不适用于Python版模型
model_id = "/home/model_zoo/LLM/llama2/CodeLlama-7b-Instruct-hf"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model_config = AutoConfig.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    config=model_config,
    torch_dtype=torch.float16
).to("cuda")

prompt = '''def remove_non_ascii(s: str) -> str:
    """ <FILL_ME>
    return result
'''

input_ids = tokenizer(prompt, return_tensors="pt")["input_ids"].to("cuda")
output = model.generate(
    input_ids,
    max_new_tokens=512,
)
output = output[0].to("cpu")

filling = tokenizer.decode(output[input_ids.shape[1]:], skip_special_tokens=True)
print(prompt.replace("<FILL_ME>", filling))

输出结果如下:

def remove_non_ascii(s: str) -> str:  """ Remove non-ASCII characters from a string.  Args:    s (str): The string to remove non-ASCII characters from.  Returns:    str: The string with non-ASCII characters removed.  """  result = ""  for c in s:    if ord(c) < 128:      result += c  return resultdef remove_non_ascii_and_spaces(s: str) -> str:  """ Remove non-ASCII and space characters from a string.  Args:    s (str): The string to remove non-ASCII and space characters from.  Returns:    str: The string with non-ASCII and space characters removed.  """  result = ""  for c in s:    if ord(c) < 128 and c != " ":      result += c  return resultdef remove_non_ascii_and_spaces_and_newlines(s: str) -> str:  """ Remove non-ASCII, space, and newline characters from a string.  Args:    s (str): The string to remove non-ASCII, space, and newline characters from.  Returns:    str: The string with non-ASCII, space, and newline characters removed.  """  result = ""  for c in s:    if ord(c) < 128 and c not in ["\n", "\r", "\t", " "]:      result += c  return resultdef remove_non_ascii_and_spaces_and_newlines_and_punctuation(s: str) -> str:  """ Remove non-ASCII, space, newline, and punctuation characters from a string.  Args:    s (str): The string to remove non-ASCII, space, newline, and punctuation characters from.  Returns:    str: The string with non-ASCII, space, newline, and punctuation characters removed.  """  result = ""  for c in s:    if ord(c) < 128 and c not in ["\  return result

如果在上述代码中强行使用CodeLlama-7b-Python-hf模型做代码填充任务,模型inference的时候可能报错:

RuntimeError: CUDA error: CUBLAS_STATUS_NOT_INITIALIZED when calling `cublasCreate(handle)`

指令编码

如前面所述基座模型可以用于代码补全和填充,Code Llama还发布了一个经过指令微调的模型,可用于对话式编程。 针对这个任务,需要使用llama2中的提示模板,具体可以参考之前的文章:Llama 2实战(上篇):本地部署(附代码) :

<s>[INST] <<SYS>>
{{ system_prompt }}
<</SYS>>

{{ user_msg_1 }} [/INST] {{ model_answer_1 }} </s><s>[INST] {{ user_msg_2 }} [/INST]

注意,系统提示是可选的,在没有它的情况下模型可以正常工作,但我们可以使用系统提示system_prompt来进一步配置模型的行为或风格。例如,总是希望得到JavaScript的代码答案,可以在这里指定。在系统提示之后,需要提供历史对话:用户询问的问题和模型的回答。与代码填充案例一样,需要注意使用分隔符。输入的最后一个组成必须始终是一个新的用户指令,这是模型提供答案的信号。以下代码片段演示了在实践中模板的工作方式。

  1. 没有system prompt的用户query

user = 'I have a pandas DataFrame df['text'], how can I directly add a list of data test_list to df['text'] to increase the number of rows?'

prompt = f"<s>[INST] {user.strip()} [/INST]"
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to("cuda")

「完整示例代码:」

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/9/5 20:49
# @Author  : 卖猪脚饭的小女孩
# @联系方式  : 微信公众号<小窗幽记机器学习>
# @File    : inference_code_instructions_hf_v2.py
"""
测试  instruction 版模型
CUDA_VISIBLE_DEVICES=2 python3 inference_code_instructions_hf_v2.py
"""
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig

model_id = "/home/model_zoo/LLM/llama2/CodeLlama-7b-Instruct-hf/"
# model_id = "codellama/CodeLlama-34b-hf"
# device_map="auto",
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
).to("cuda")

user_query = "I have a pandas DataFrame df['text'], how can I directly add a list of data test_list to df['text'] to increase the number of rows?"

prompt = f"<s>[INST] {user_query.strip()} [/INST]"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")

output = model.generate(
    inputs["input_ids"],
    max_new_tokens=512,
    do_sample=True,
    top_p=0.9,
    temperature=0.1,
)
output = output[0].to("cpu")
print(tokenizer.decode(output))

输出结果如下:

<s><s> [INST] I have a pandas DataFrame df['text'], how can I directly add a list of data test_list to df['text'] to increase the number of rows? [/INST]  You can use the `append` method to add a list of data to a pandas DataFrame. Here's an example:```import pandas as pd# create a sample DataFramedf = pd.DataFrame({'text': ['hello', 'world']})# create a list of data to addtest_list = ['foo', 'bar', 'baz']# add the list to the DataFramedf['text'] = df['text'].append(test_list)print(df)```This will output:```   text0  hello1  world2  foo3  bar4  baz```Note that the `append` method returns a new DataFrame with the added data, so you need to assign the result back to the original DataFrame.Alternatively, you can use the `concat` function to concatenate the DataFrame with the list of data:```import pandas as pd# create a sample DataFramedf = pd.DataFrame({'text': ['hello', 'world']})# create a list of data to addtest_list = ['foo', 'bar', 'baz']# concatenate the DataFrame with the list of datadf = pd.concat([df, pd.DataFrame({'text': test_list})])print(df)```This will output the same result as the previous example.</s>

可以看出,输出了2种代码。 第一种:

import pandas as pd

# create a sample DataFrame
df = pd.DataFrame({'text': ['hello', 'world']})

# create a list of data to add
test_list = ['foo', 'bar', 'baz']

# add the list to the DataFrame
df['text'] = df['text'].append(test_list)

print(df)

第一种代码写法无法正常运行。

第二种:

import pandas as pd

# create a sample DataFrame
df = pd.DataFrame({'text': ['hello', 'world']})

# create a list of data to add
test_list = ['foo', 'bar', 'baz']

# concatenate the DataFrame with the list of data
df = pd.concat([df, pd.DataFrame({'text': test_list})])

print(df)

经过测试,第二种写法可以正常运行,且结果符合预期。

所以,简单的代码需求,CodeLlama-7b-Instruct-hf表现一般,可能存在一些比较明显的坑。

进一步尝试使用34B版模型:CodeLlama-34b-Instruct-hf,生成代码如下:

import pandas as pd

# create a sample DataFrame with a 'text' column
df = pd.DataFrame({'text': ['hello', 'world', 'this', 'is', 'a', 'test']})

# create a list of data to add to the 'text' column
test_list = ['new', 'data', 'to', 'add']

# concatenate the 'text' column with the test_list
df['text'] = pd.concat([df['text'], test_list])

print(df)

上述代码直接运行会报错:

TypeError: cannot concatenate object of type '<class 'list'>'; only Series and DataFrame objs are valid
  1. 带system prompt的用户query

system = "Provide answers in C++"
user = "Write a function that computes the set of sums of all contiguous sublists of a given list."

prompt = f"<s><<SYS>>\\n{system}\\n<</SYS>>\\n\\n{user}"
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to("cuda")

  1. 带历史对话的持续对话

system = "System prompt"
user_1 = "user_prompt_1"
answer_1 = "answer_1"
user_2 = "user_prompt_2"
answer_2 = "answer_2"
user_3 = "user_prompt_3"

prompt  = f"<<SYS>>\\n{system}\\n<</SYS>>\\n\\n{user_1}"
prompt  = f"<s>[INST] {prompt.strip()} [/INST] {answer_1.strip()} </s>"
prompt += f"<s>[INST] {user_2.strip()} [/INST] {answer_2.strip()} </s>"
prompt += f"<s>[INST] {user_3.strip()} [/INST]"

inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to("cuda")

ChatGPT vs GPT4

延续上述指令编程中的panda行方向数据扩增这一代码需求,在ChatGPT和GPT4上对比测试。由于ChatGPT和GPT4都支持中文输入,所以直接使用中文Promp输入:

我有一个pandas数据 df['text'],如何将一个list数据test_list直接添加到df['text']中,使得行数变多

「ChatGPT生成结果如下:」

import pandas as pd

# 原始数据
df = pd.DataFrame({'text': ['hello', 'world']})

# 要添加的数据
test_list = ['foo', 'bar']

# 将test_list作为一个新的DataFrame对象添加到原始DataFrame对象中
new_df = df.append(pd.DataFrame({'text': test_list}), ignore_index=True)

# 打印结果
print(new_df)

ChatGPT生成代码运行结果如下:

   text
0  hello
1  world
2    foo
3    bar

「GPT4生成结果如下:」

# 假设这是你的原始DataFrame
import pandas as pd
df = pd.DataFrame({'text': ['hello', 'world']})

# 这是你要添加的list
test_list = ['foo', 'bar']

# 将list转换为DataFrame
new_df = pd.DataFrame({'text': test_list})

# 使用append方法将新的DataFrame添加到原来的DataFrame中
df = df.append(new_df, ignore_index=True)

print(df)

GPT4生成代码运行结果如下:

    text
0  hello
1  world
2    foo
3    bar

可以看出,对于简单的代码需求,ChatGPT和GPT4都cover住。

功能任务是否正常运行结果是否符合预期总体评估
代码补全(34B版)求斐波那契数列yesyes😀
代码补全(34B-4bit版)去除非ascii字符yesyes😀
代码填充(7B-Instruct版)去除非ascii字符yesyes😀
指令编程(7B-Instruct版)pandas指定列增加行数据yes & noyes & no🙁
指令编程(34B-Instruct版)pandas指定列增加行数据nono😭
ChatGPTpandas指定列增加行数据yesyes😀
GPT-4pandas指定列增加行数据yesyes😀

小结

在普通代码需求上,现阶段的Code Llama模型仍然有一些明显的瑕疵,实战效果仍不如ChatGPT和GPT4。相信Code Llama后续的发展及其成长可以进一步趋近当下的ChatGPT和GPT4。

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

36基于matlab的对分解层数和惩罚因子进行优化

基于matlab的对分解层数和惩罚因子进行优化。蚁狮优化算法优化VMD,算术优化算法优化VMD&#xff0c;遗传优化算法优化VMD&#xff0c;灰狼优化算法优化VMD&#xff0c;海洋捕食者优化算法优化VMD&#xff0c;粒子群优化VMD&#xff0c;麻雀优化算法优化VMD&#xff0c;鲸鱼优化…

如何使用 nvm-windows 这个工具来管理你电脑上的Node.js版本

nvm-windows 是一个用于管理在 Windows 上安装的多个 Node.js 版本的工具。以下是安装和使用 nvm-windows 的步骤&#xff1a; 第1步&#xff1a;下载 nvm-windows 访问 nvm-windows 的 GitHub发布页面.下载最新版本的 nvm-setup.zip 文件。 第2步&#xff1a;安装 nvm-wind…

KV STUDIO的安装与实践(一)

目录 什么是KV STUDIO&#xff1f; 如何安装KV STUDIO&#xff1f; 如何学习与使用KV STUDIO&#xff08;在现实中的应用&#xff09;&#xff1f; 应用一&#xff08;在现实生活中机器内部plc的读取与替换&#xff09; 读取 KV STUDIO实现显示器的检测&#xff01;&#…

微信小程序发货信息录入

微信小程序发货信息录入 一、发货信息录入接口 1、 用户交易后&#xff0c;默认资金将会进入冻结状态&#xff0c;开发者在发货后&#xff0c;需要在小程序平台录入相关发货信息&#xff0c;平台会将发货信息以消息的形式推送给购买的微信用户。 2、 如果你已经录入发货信息…

lossBN

still tips for learning classification and regression关于softmax的引入和作用分类问题损失函数 - MSE & Cross-entropy⭐Batch Normalization&#xff08;BN&#xff09;⭐想法&#xff1a;直接改error surface的landscape&#xff0c;把山铲平feature normalization那…

夯实c语言基础

夯实c语言基础 转义字符 • \? &#xff1a;在书写连续多个问号时使⽤&#xff0c;防⽌他们被解析成三字⺟词&#xff0c;在新的编译器上没法验证了。 • \ &#xff1a;⽤于表⽰字符常量 • \" &#xff1a;⽤于表⽰⼀个字符串内部的双引号 • \\ &#xff1a;⽤于表…

分享微信卸载重装恢复记录的3个方法!

微信是一款功能丰富、便捷实用的通信应用程序&#xff0c;为用户提供了方便、快速的即时通讯功能。无论您身在何处&#xff0c;通过微信&#xff0c;您可以轻松与家人、朋友保持紧密联系。有时候&#xff0c;为了能扩大手机内存空间&#xff0c;一些小伙伴可能会选择把微信卸载…

Sql Server中的表组织和索引组织(聚集索引结构,非聚集索引结构,堆结构)

正文 SqlServer用三种方法来组织其分区中的数据或索引页&#xff1a; 1、聚集索引结构 聚集索引是按B树结构进行组织的&#xff0c;B树中的每一页称为一个索引节点。每个索引行包含一个键值和一个指针。指针指向B树上的某一中间级页&#xff08;比如根节点指向中间级节点中的…

【软考系统架构设计师】2023年系统架构师冲刺模拟习题之《软件工程》

在软考中软件工程模块主要包含以下考点&#xff1a; 文章目录 软件过程模型&#x1f31f;&#x1f31f;&#x1f31f;&#x1f31f;逆向工程&#x1f31f;基于构件的软件工程&#x1f31f;&#x1f31f;软件开发与软件设计与维护净室软件工程软件模型软件需求 软件过程模型&am…

Makefile 基础教程:从零开始学习

在软件开发过程中&#xff0c;Makefile是一个非常重要的工具&#xff0c;它可以帮助我们自动构建程序&#xff0c;管理程序依赖关系&#xff0c;提高开发效率。本篇博客将从基础开始&#xff0c;介绍Makefile的相关知识&#xff0c;帮助大家快速掌握Makefile的使用方法 Makefil…

专转本VS工作,两年后有什么区别?

很多同学在面对“是否要专转本”这件事上&#xff0c;还在摇摆不定&#xff0c;抱着不转本就工作的想法&#xff0c;觉得“工作赚钱”会更好。选择转本还是进入社会工作&#xff0c;这可能是每个大三生都有过思索的。之所以纠结&#xff0c;无非就是想要提升学历但害怕考不上&a…

【Javascript】ajax(阿甲克斯)

目录 什么是ajax? 同步与异步 原理 注意 写一个ajax请求 创建ajax对象 设置请求方式和地址 发送请求 设置响应HTTP请求状态变化的函数 什么是ajax? 是基于javascript的一种用于创建快速动态网页的技术&#xff0c;是一种在无需重新加载整个网页的情况下&#xff0c…

『力扣刷题本』:合并两个有序链表(递归解法)

一、题目 将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 示例 1&#xff1a; 输入&#xff1a;l1 [1,2,4], l2 [1,3,4] 输出&#xff1a;[1,1,2,3,4,4]示例 2&#xff1a; 输入&#xff1a;l1 [], l2 [] 输出&#x…

K8s概念汇总-笔记

目录 1.Master 1.1在Master上运⾏着以下关键进程 2.什么是Node? 1.2在每个Node上都运⾏着以下关键进程 3.什么是 Pod ? 4. 什么是Label &#xff1f; 5.Replication Controller 6.Deployment 6.1Deployment的典型场景&#xff1a; 7.Horizontal Pod Autoscaler TODO…

Node.js的基本概念node -v 和npm -v 这两个命令的作用

Node.js 是一个开源且跨平台的 JavaScript 运行时环境&#xff0c;它可以让你在服务器端运行 JavaScript 代码。Node.js 使用了 Chrome 的 V8 JavaScript 引擎来执行代码&#xff0c;非常高效。 在 Node.js 出现之前&#xff0c;JavaScript 通常只在浏览器中运行&#xff0c;用…

物联网和互联网医院小程序:如何实现医疗设备的远程监测和管理?

物联网&#xff08;IoT&#xff09;技术的发展为医疗设备的远程监测和管理提供了巨大的机会。结合互联网医院小程序&#xff0c;我们可以实现对医疗设备的远程访问、监控和管理&#xff0c;从而提高医疗服务的质量和效率。本文将介绍如何实现医疗设备的远程监测和管理&#xff…

漏洞复现-phpmyadmin_SQL注入 (CVE-2020-5504)

phpmyadmin SQL注入 _&#xff08;CVE-2020-5504&#xff09; 漏洞信息 CVE-2020-5504sql注入漏洞Phpmyadmin 5.00以下 描述 ​ phpMyAdmin是Phpmyadmin团队的一套免费的、基于Web的MySQL数据库管理工具。该工具能够创建和删除数据库&#xff0c;创建、删除、修改数据库表&…

Microsoft.Extensions 简介

Microsoft.Extensions 简介 一、Microsoft.Extensions 简介 .NET Extensions 是一套官方的、开源的、跨平台的 API 集合&#xff0c;提供了一些常用的编程模式和实用工具&#xff0c;例如依赖项注入、日志记录、缓存、Host以及配置等等。该项目的大多数 API 都被用在 .NET 平…

Ocelot简易教程目录

Ocelot简易教程目录 这里写目录标题 Ocelot简易教程目录 Ocelot简易教程&#xff08;一&#xff09;之Ocelot是什么Ocelot简易教程&#xff08;二&#xff09;之快速开始1Ocelot简易教程&#xff08;二&#xff09;之快速开始2Ocelot简易教程&#xff08;三&#xff09;之主要特…

计算机网络基础一

任务背景 由于某些原因&#xff0c;某公司搬迁至新地方&#xff0c;现需要对公司网络环境重新调整规划&#xff0c;申请了一个 B 类 IP 地址 : 172.25.0.0 &#xff0c;子 网掩码为 255.255.224.0 。需要根据公司部门和电脑数进行子网划分并分配 IP 。公司目前有 6 个部门&am…