基于xiaothink对Wanyv-50M模型进行c-eval评估
使用pypi安装xiaothink:
pip install xiaothink==1.0.2
下载模型:
万语-50M
开始评估(修改模型路径后即可直接开始运行,结果保存在output文件夹里):
import os
import json
import pandas as pd
import re
from tqdm import tqdm
import random
import time
import requests
from xiaothink.llm.inference.test_formal import *
model=QianyanModel(MT=40.231,ckpt_dir=r'path\to\wanyv\model\ckpt_test_40_2_3_1_formal_open')def chat_x(inp,temp=0.3):return model.chat_SingleTurn(inp,temp=temp,loop=True,stop='。')#from collections import Counterdef pre(question: str, options_str: str) -> str:question = question.replace('答案:', '')options_str = options_str.replace('答案:', '')if not 'A' in question:#你只需要直接-让我们首先一步步思考,最后在回答末尾prompt_template = '''题目:{question}\n{options_str}\n让我们首先一步步思考,最后在回答末尾给出一个字母作为你的答案(A或B或C或D)'''prompt_template2 = '''题目:{question}\n选项:{options_str}\n给出答案'''prompt_template3 = '''{question}\n{options_str}\n'''prompt_template4 = '''{question}\n{options_str}\n给出你的选择'''prompt_template5 = '''题目:{question}\n{options_str}\n答案:'''else:prompt_template = '''题目:{question}\n让我们首先一步步思考,最后在回答末尾给出一个字母作为你的答案(A或B或C或D)'''prompt_template2 = '''题目:{question}\n给出答案'''prompt_template3 = '''{question}\n'''prompt_template4 = '''{question}\n给出你的选择'''prompt_template5 = '''题目:{question}\n答案:'''ansd={}# Run the chat_core function 5 times and collect answersanswers = []for _ in range(1):response = chat_x(prompt_template.format(question=question, options_str=options_str))#print(response)# Extract answer from responsefor option in 'ABCD':if option in response:answers.append(option)ansd[option]=responsebreakelse:print('AI选项检查:', repr(response))answers.append('A') # Default to 'A' if no option foundansd['A']=''# Count occurrences of each answeranswer_counts = Counter(answers)# Find the most common answer(s)most_common_answers = answer_counts.most_common()highest_frequency = most_common_answers[0][1]most_frequent_answers = [answer for answer, count in most_common_answers if count == highest_frequency]# Choose one of the most frequent answers (if there's a tie, choose the first alphabetically)final_answer = min(most_frequent_answers)with open('ceval_text_sklm.txt','a',encoding='utf-8') as f:f.write(
'{"instruction": "{prompt_template}", "input": "", "output": "{final_answer}"}\n'.replace('{prompt_template}',prompt_template.format(question=question, options_str=options_str).replace('\n','\\n')).replace('{final_answer}',ansd[final_answer]),)with open('ceval_text_sklm.txt','a',encoding='utf-8') as f:f.write(
'{"instruction": "{prompt_template}", "input": "", "output": "{final_answer}"}\n'.replace('{prompt_template}',prompt_template2.format(question=question, options_str=options_str).replace('\n','\\n')).replace('{final_answer}',ansd[final_answer]),)with open('ceval_text_sklm.txt','a',encoding='utf-8') as f:f.write(
'{"instruction": "{prompt_template}", "input": "", "output": "{final_answer}"}\n'.replace('{prompt_template}',prompt_template3.format(question=question, options_str=options_str).replace('\n','\\n')).replace('{final_answer}',ansd[final_answer]),)with open('ceval_text_sklm.txt','a',encoding='utf-8') as f:f.write(
'{"instruction": "{prompt_template}", "input": "", "output": "{final_answer}"}\n'.replace('{prompt_template}',prompt_template4.format(question=question, options_str=options_str).replace('\n','\\n')).replace('{final_answer}',ansd[final_answer]),)with open('ceval_text_sklm.txt','a',encoding='utf-8') as f:f.write(
'{"instruction": "{prompt_template}", "input": "", "output": "{final_answer}"}\n'.replace('{prompt_template}',prompt_template5.format(question=question, options_str=options_str).replace('\n','\\n')).replace('{final_answer}',ansd[final_answer]),)return final_answerclass Llama_Evaluator:def __init__(self, choices, k):self.choices = choicesself.k = kdef eval_subject(self, subject_name,test_df,dev_df=None,few_shot=False,cot=False,save_result_dir=None,with_prompt=False,constrained_decoding=False,do_test=False):all_answers = {}correct_num = 0if save_result_dir:result = []score = []if few_shot:history = self.generate_few_shot_prompt(subject_name, dev_df, cot=cot)else:history = ''answers = ['NA'] * len(test_df) if do_test is True else list(test_df['answer'])for row_index, row in tqdm(test_df.iterrows(), total=len(test_df)):question = self.format_example(row, include_answer=False, cot=cot, with_prompt=with_prompt)options_str = self.format_options(row)instruction = history + question + "\n选项:" + options_strans = pre(instruction, options_str)if ans == answers[row_index]:correct_num += 1correct = 1else:correct = 0print(f"\n=======begin {str(row_index)}=======")print("question: ", question)print("options: ", options_str)print("ans: ", ans)print("ground truth: ", answers[row_index], "\n")if save_result_dir:result.append(ans)score.append(correct)print(f"=======end {str(row_index)}=======")all_answers[str(row_index)] = anscorrect_ratio = 100 * correct_num / len(answers)if save_result_dir:test_df['model_output'] = resulttest_df['correctness'] = scoretest_df.to_csv(os.path.join(save_result_dir, f'{subject_name}_test.csv'))return correct_ratio, all_answersdef format_example(self, line, include_answer=True, cot=False, with_prompt=False):example = line['question']for choice in self.choices:example += f'\n{choice}. {line[f"{choice}"]}'if include_answer:if cot:example += "\n答案:让我们一步一步思考,\n" + \line["explanation"] + f"\n所以答案是{line['answer']}。\n\n"else:example += '\n答案:' + line["answer"] + '\n\n'else:if with_prompt is False:if cot:example += "\n答案:让我们一步一步思考,\n1."else:example += '\n答案:'else:if cot:example += "\n答案是什么?让我们一步一步思考,\n1."else:example += '\n答案是什么? 'return exampledef generate_few_shot_prompt(self, subject, dev_df, cot=False):prompt = f"以下是中国关于{subject}考试的单项选择题,请选出其中的正确答案。\n\n"k = self.kif self.k == -1:k = dev_df.shape[0]for i in range(k):prompt += self.format_example(dev_df.iloc[i, :],include_answer=True,cot=cot)return promptdef format_options(self, line):options_str = ""for choice in self.choices:options_str += f"{choice}: {line[f'{choice}']} "return options_strdef main(model_path, output_dir, take, few_shot=False, cot=False, with_prompt=False, constrained_decoding=False, do_test=False, n_times=1, do_save_csv=False):assert os.path.exists("subject_mapping.json"), "subject_mapping.json not found!"with open("subject_mapping.json") as f:subject_mapping = json.load(f)filenames = os.listdir("data/val")subject_list = [val_file.replace("_val.csv", "") for val_file in filenames]accuracy, summary = {}, {}run_date = time.strftime('%Y-%m-%d_%H-%M-%S', time.localtime(time.time()))save_result_dir = os.path.join(output_dir, f"take{take}")if not os.path.exists(save_result_dir):os.makedirs(save_result_dir, exist_ok=True)evaluator = Llama_Evaluator(choices=choices, k=n_times)all_answers = {}for index, subject_name in tqdm(list(enumerate(subject_list)),desc='主进度'):print(f"{index / len(subject_list)} Inference starts at {run_date} on {model_path} with subject of {subject_name}!")val_file_path = os.path.join('data/val', f'{subject_name}_val.csv')dev_file_path = os.path.join('data/dev', f'{subject_name}_dev.csv')test_file_path = os.path.join('data/test', f'{subject_name}_test.csv')val_df = pd.read_csv(val_file_path) if not do_test else pd.read_csv(test_file_path)dev_df = pd.read_csv(dev_file_path) if few_shot else Nonecorrect_ratio, answers = evaluator.eval_subject(subject_name, val_df, dev_df,save_result_dir=save_result_dir if do_save_csv else None,few_shot=few_shot,cot=cot,with_prompt=with_prompt,constrained_decoding=constrained_decoding,do_test=do_test)print(f"Subject: {subject_name}")print(f"Acc: {correct_ratio}")accuracy[subject_name] = correct_ratiosummary[subject_name] = {"score": correct_ratio,"num": len(val_df),"correct": correct_ratio * len(val_df) / 100}all_answers[subject_name] = answersjson.dump(all_answers, open(save_result_dir + '/submission.json', 'w'), ensure_ascii=False, indent=4)print("Accuracy:")for k, v in accuracy.items():print(k, ": ", v)total_num = 0total_correct = 0summary['grouped'] = {"STEM": {"correct": 0.0, "num": 0},"Social Science": {"correct": 0.0, "num": 0},"Humanities": {"correct": 0.0, "num": 0},"Other": {"correct": 0.0, "num": 0}}for subj, info in subject_mapping.items():group = info[2]summary['grouped'][group]["num"] += summary[subj]['num']summary['grouped'][group]["correct"] += summary[subj]['correct']for group, info in summary['grouped'].items():info['score'] = info["correct"] / info["num"]total_num += info["num"]total_correct += info["correct"]summary['All'] = {"score": total_correct / total_num, "num": total_num, "correct": total_correct}json.dump(summary, open(save_result_dir + '/summary.json', 'w'), ensure_ascii=False, indent=2)# Example usage
if __name__ == "__main__":model_path = "path/to/model"output_dir = "output"take = 0few_shot = Falsecot = Falsewith_prompt = Falseconstrained_decoding = Falsedo_test = True#Falsen_times = 1do_save_csv = Falsemain(model_path, output_dir, take, few_shot, cot, with_prompt, constrained_decoding, do_test, n_times, do_save_csv)
相关文章:
基于xiaothink对Wanyv-50M模型进行c-eval评估
使用pypi安装xiaothink: pip install xiaothink1.0.2下载模型: 万语-50M 开始评估(修改模型路径后即可直接开始运行,结果保存在output文件夹里): import os import json import pandas as pd import re from tqdm import tqdm i…...
大模型项目如何成功落地?
随着人工智能的快速发展,大模型已经成为企业转型和提升效率的关键工具。要让大模型成功落地,需要几个关键要素,以及明白如何组建一个高效的团队。 首先,成功的关键在于业务人员的积极参与,这是项目成功的起点。 其次…...
重构(二)
继续"提高代码质量" 接着上文提高代码质量, 需要从这几个特点入手 1、代码重用性。2、可读性。3、可扩展性。4、可靠性。5、高内聚,低耦合。 仅仅就"可读性"去分析一下吧, 毕竟例子实在是太多了 递归的"可读性"不如while循环 递归…...
Sapro编程软件
Sapro软件是由西门子建筑科技公司开发的一款编程软件,主要用于Climatix控制器的编程、调试及相关功能实现.以下是其具体介绍: • 功能强大:可进行HVAC控制编程,实现设备控制、HMI用户访问和设备集成等功能,满足复杂的…...
EasyGBS国标GB28181公网平台P2P远程访问故障诊断:云端服务端排查指南
随着信息技术的飞速发展,视频监控领域正经历从传统安防向智能化、网络化安防的深刻转变。EasyGBS平台,作为基于国标GB28181协议的视频流媒体平台,为用户提供了强大的视频监控直播功能。然而,在实际应用中,P2P远程访问可…...
学生管理系统,增加教师管理,班级管理,角色功能权限管理
为了在现有的学生管理系统中增加**教师管理**、**班级管理**以及**角色和权限管理**,我们需要对数据库进行扩展,并相应地更新 Python 代码和用户界面。以下是详细的步骤和代码示例。 ## 1. 数据库扩展 ### 1.1 创建新表 #### 教师表 (teachers) sql …...
Vue CLI 脚手架创建项目流程详解 (2)
更新 CLI 脚手架 确保你安装的是最新版本的 Vue CLI,以支持最新的特性及改进。你可以通过以下命令全局安装或更新 Vue CLI: npm install -g vue/cli创建 Vue 3.x 项目 启动创建向导 使用 vue create 命令来开始创建一个新的 Vue 项目: vue …...
LabVIEW机械故障诊断中的传感器选择
在机械设备故障诊断中,传感器是关键设备,用于采集设备运行状态的各种数据。常见的传感器类型和选择方法如下: 1. 振动传感器 用于检测设备运行中的振动特征,常见于旋转机械和轴承故障诊断。 加速度传感器:检测高频振…...
二叉树_堆
目录 一. 树(非线性结构) 1.1 树的概念与结构 1.2 树的表示 二. 二叉树 2.1 二叉树的概念与结构 2.2 特殊的二叉树 2.3 二叉树的存储结构 三. 实现顺序结构的二叉树 3.1 堆的概念与结构 一. 树(非线性结构) 1.1 树的概念与结构 概念ÿ…...
Java图片拼接
最近遇到一个挺离谱的功能,某个表单只让上传一张图,多图上传会使导出失败。跟开发沟通后表示,这个问题处理不了。我... 遂自己思考,能否以曲线救国的方式拯救一下,即不伤及代码之根本,又能解决燃眉之急。灵…...
使用qemu搭建armv7嵌入式开发环境
目录 目录 1 概述 2 环境准备 2.1 vexpress系列开发板介绍 2.2 安装工具 2.2.1 安装交叉工具链 2.2.2 安装qemu 2.2.3 安装其他工具 3 启动uboot 3.1 uboot下载与编译 3.1.1 下载 3.1.2 编译 3.2 使用qemu启动uboot 4 启动kernel 4.1 下载和编译kernel 4.1.1 下…...
新版国标GB28181设备端Android版EasyGBD支持国标GB28181-2022,支持语音对讲,支持位置上报,开源在Github
经过近3个月的迭代开发,新版本的国标GB28181设备端EasyGBD安卓Android版终于在昨天发布到Github了,最新的EasyGBD支持了国标GB28181-2022版,还支持了语音对讲、位置上报、本地录像等功能,比原有GB28181-2016版的EasyGBD更加高效、…...
Hashtable 描述及源码解析
目录 一、Hashtable的基本概念 二、Hashtable的源码解析 构造函数 哈希算法函数 处理哈希冲突 类定义和成员变量 构造方法 插入元素 查找元素 删除元素 扩容 Hashtable(哈希表)是一种非常重要的数据结构,它提供了快速的数据插入、删…...
clickhouse-数据库引擎
1、数据库引擎和表引擎 数据库引擎默认是Ordinary,在这种数据库下面的表可以是任意类型引擎。 生产环境中常用的表引擎是MergeTree系列,也是官方主推的引擎。 MergeTree是基础引擎,有主键索引、数据分区、数据副本、数据采样、删除和修改等功…...
深度学习之超分辨率算法——SRCNN
网络为基础卷积层 tensorflow 1.14 scipy 1.2.1 numpy 1.16 大概意思就是针对数据,我们先把图片按缩小因子照整数倍进行缩减为小图片,再针对小图片进行插值算法,获得还原后的低分辨率的图片作为标签。 main.py 配置文件 from model im…...
本机如何连接虚拟机MYSQL
要让本机(主机)连接到虚拟机上的 MySQL 数据库,你需要确保虚拟机和主机之间的网络连接正常,并且 MySQL 配置允许外部连接。以下是实现本机连接虚拟机 MySQL 的步骤: 步骤 1:确认虚拟机与本机的网络连接 确…...
mac 安装graalvm
Download GraalVM 上面链接选择jdk的版本 以及系统的环境下载graalvm的tar包 解压tar包 tar -xzf graalvm-jdk-<version>_macos-<architecture>.tar.gz 移入java的文件夹目录 sudo mv graalvm-jdk-<version> /Library/Java/JavaVirtualMachines 设置环境变…...
大模型日报 2024-12-19
大模型日报 2024-12-19 大模型资讯 标题:OpenAI发布季第十天:ChatGPT登陆电话、WhatsApp,你可以给ChatGPT真正打电话了 摘要:OpenAI于2024年12月18日发布了ChatGPT的新功能,用户可以通过电话和WhatsApp与ChatGPT进行互…...
【数据结构练习题】链表与LinkedList
顺序表与链表LinkedList 选择题链表面试题1. 删除链表中等于给定值 val 的所有节点。2. 反转一个单链表。3. 给定一个带有头结点 head 的非空单链表,返回链表的中间结点。如果有两个中间结点,则返回第二个中间结点。4. 输入一个链表,输出该链…...
使用 acme.sh 申请域名 SSL/TLS 证书完整指南
使用 acme.sh 申请域名 SSL/TLS 证书完整指南 简介为什么选择 acme.sh 和 ZeroSSL?前置要求安装过程 步骤一:安装 acme.sh步骤二:配置 ZeroSSL 证书申请 方法一:手动 DNS 验证(推荐新手使用)方法二…...
微信小程序开发入门
实现滚动 需要设置高度和边框 轮播图 差值表达式( {{表达式的值}} ),info数据要写到js文件的data数据中 小程序中常用的事件...
【LeetCode】9、回文数
【LeetCode】9、回文数 文章目录 一、数学: 除法和取模1.1 数学: 除法和取模 二、多语言解法 一、数学: 除法和取模 1.1 数学: 除法和取模 例如 15251, offset 也是五位数的 10000 先判断首1和尾1, 再变为 525, offset 变为 100 再判断首5和尾5, 再变为 2, offset 变为 1 整个…...
面试题整理9----谈谈对k8s的理解2
面试题整理9----谈谈对k8s的理解2 1. Service 资源1.1 ServiceClusterIPNodePortLoadBalancerIngressExternalName 1.2 Endpoints1.3 Ingress1.4 EndpointSlice1.5 IngressClass 2. 配置和存储资源2.1 ConfigMap2.2 Secret2.3 PersistentVolume2.4 PersistentVolumeClaim2.5 St…...
fpga系列 HDL:Quartus II PLL (Phase-Locked Loop) IP核 (Quartus II 18.0)
在 Quartus II 中使用 PLL (Phase-Locked Loop) 模块来将输入时钟分频或倍频,并生成多个相位偏移或频率不同的时钟信号: 1. 生成 PLL 模块 在 Quartus II 中: 打开 IP Components。 file:///C:/intelFPGA_lite/18.0/quartus/common/help/w…...
中国量子计算机领域的发展现状与展望
中国量子计算机领域的发展现状与展望 摘要 随着全球科技竞争的加剧,量子计算作为前沿技术领域备受瞩目。中国在量子计算机的研发方面取得了显著进展,本文将深入探讨中国量子计算机领域的现状、取得的成果、面临的挑战以及未来的发展方向,并…...
html(超文本标记语言)
声明! 学习视频来自B站up主 **泷羽sec** 有兴趣的师傅可以关注一下,如涉及侵权马上删除文章,笔记只是方便各位师傅的学习和探讨,文章所提到的网站以及内容,只做学习交流,其他均与本人以及泷羽sec团队无关&…...
如何在Windows系统上安装和配置Maven
Maven是一个强大的构建和项目管理工具,广泛应用于Java项目的自动化构建、依赖管理、项目构建生命周期控制等方面。在Windows系统上安装Maven并配置环境变量,是开发者开始使用Maven的第一步。本文将详细介绍如何在Windows系统上安装和配置Maven࿰…...
基于Python Scrapy的豆瓣Top250电影爬虫程序
Scrapy安装 Python实现一个简单的爬虫程序(爬取图片)_python简单扒图脚本-CSDN博客 创建爬虫项目 创建爬虫项目: scrapy startproject test_spider 创建爬虫程序文件: >cd test_spider\test_spider\spiders >scrapy g…...
mysql,数据库数据备份
mysql 一.数据库备份概念1.备份分类2.备份策略3.备份三要素二.完全备份操作1.物理备份(还原),冷备份2.逻辑备份,温备份三.percona软件的xtrabackup工具备份(2备份,3还原),增量,差异1.percona软件安装2.增量备份(还原)3.差异备份四.binlog日志1.binlog日志概念2.查看binlog日志信…...
模仿elementui的Table,实现思路
vue2子组件使用render,给子子组件插槽传值 和elementui的Table一样使用render 在 Vue 2 中,子组件使用render函数向子子组件插槽传值可以通过以下步骤实现: 1、创建子组件 首先创建一个子组件,在子组件中使用render函数来渲染内容…...
Android Studio AI助手---Gemini
从金丝雀频道下载最新版 Android Studio,以利用所有这些新功能,并继续阅读以了解新增内容。 Gemini 现在可以编写、重构和记录 Android 代码 Gemini 不仅仅是提供指导。它可以编辑您的代码,帮助您快速从原型转向实现,实现常见的…...
大模型+安全实践之春天何时到来?
引子:距《在大模型实践旅途中摸了下上帝的脚指头》一文发布近一年,2024年笔者继续全情投入在大模型+安全上,深度参与了一些应用实践,包括安全大模型首次大规模应用在国家级攻防演习、部分项目的POC直到项目落地,也推动了一些场景安全大模型应用从0到3的孵化上市。这一年也…...
ACL技术---访问控制列表
是一种策略。 对于网络中的流量而言,通常有两种处理方式 允许 拒绝 ACL 的原理 配置了 ACL 的网络设备会根据事先设定好的报文匹配规则对经过该设备的报文进行匹配,然后对报 文执行预先设定好的处理动作。 ACL 的功能 访问控制:在设备…...
第25周:文献阅读
目录 摘要 Abstract 文献阅读 现有问题 提出方法 创新点 方法论 实验研究 数据集 数据预处理 仿真实验 评价指标 实验结果分析 总结 摘要 本篇论文提出了一种基于深度学习框架的风速预测方法——SSA-BiLSTM网络,旨在提高风速预测的精确性。研究使…...
BiTCN-BiGRU基于双向时间卷积网络结合双向门控循环单元的数据多特征分类预测(多输入单输出)
Matlab实现BiTCN-BiGRU基于双向时间卷积网络结合双向门控循环单元的数据多特征分类预测(多输入单输出) 目录 Matlab实现BiTCN-BiGRU基于双向时间卷积网络结合双向门控循环单元的数据多特征分类预测(多输入单输出)分类效果基本描述…...
docker数据卷
什么是数据卷? 在容器中是无法通过vi命令对一个容器中的资源做修改的,这个时候就需要通过数据卷将文件中的内容映射到宿主机,在宿主机修改的文件会更新到容器中,并且容器被删除后不会把数据卷删除,数据卷中的数据会被持…...
Linux下基于最新稳定版ESP-IDF5.3.2开发esp32s3入门任务间的通讯-信号量【入门三】
继续上一篇任务创建 【Linux下基于最新稳定版ESP-IDF5.3.2开发esp32s3入门任务创建【入门二】-CSDN博客】 今天要实现再创建一个任务。【二值和互斥都进行测试】 ①、通过任务A发送一个信号量,另一个任务得到信号量后再发送helloworld。 ②、两个任务通过互斥信…...
使用C#绘制具有平滑阴影颜色的曼德布洛特集分形
示例使用复数类在 C# 中轻松绘制曼德布洛特集分形解释了如何通过迭代方程绘制曼德布洛特集:...
Unittest01|TestCase
一、入门 1、新建测试文件 打开pycharm→左上角新建项目→选择项目路径→选择python解释器→创建→点击新建好的项目,右键新建python文件→测试文件(py文件)命名必须以test开头 2、创建测试用例 定义测试类:导入unittest模块→…...
Django实现异步视图asyncio请求
随着现代Web应用程序对性能和响应速度的需求不断增加,开发者们越来越倾向于采用异步编程来提升应用的效率和用户体验。在传统的Web开发框架中,通常采用同步请求方式,这意味着每一个请求都需要等待前一个请求完成后才能继续处理。对于高并发的请求,可能会出现性能瓶颈。而Dj…...
Apache Samza开源的分布式流处理框架
Apache Samza 是一个开源的分布式流处理框架,用于处理实时数据流和分布式任务。它最初由 LinkedIn 开发,并在 2014 年捐赠给 Apache 软件基金会。Samza 的设计目标是为开发人员提供一个易用、可靠、高效的流处理工具。以下是其关键特点和架构的简介: 核心特点 简单的编程模…...
Linux实验报告5-shell脚本编程进阶
目录 一:实验目的 二:实验内容 1 编写脚本,实现将当前目录中所有子目录的名称输出到屏幕上。 2 首先以你的姓氏的拼音为开头在当前用户的主目录下新建3个文件和2个子目录,如zi1,zi2,zi3以及子目录zi.d和…...
YOLO系列正传(四)YOLOv3论文精解(下)——损失函数推导与其他优化项
系列文章 YOLO系列基础 YOLO系列基础合集——小白也看得懂的论文精解-CSDN博客 YOLO系列正传 YOLO系列正传(一)类别损失与MSE损失函数、交叉熵损失函数-CSDN博客 YOLO系列正传(二)YOLOv3论文精解(上)——从FPN到darknet-53-C…...
【漏洞复现】CVE-2023-37461 Arbitrary File Writing
漏洞信息 NVD - cve-2023-37461 Metersphere is an opensource testing framework. Files uploaded to Metersphere may define a belongType value with a relative path like ../../../../ which may cause metersphere to attempt to overwrite an existing file in the d…...
【OpenCV计算机视觉】图像处理——平滑
本篇文章记录我学习【OpenCV】图像处理中关于“平滑”的知识点,希望我的分享对你有所帮助。 目录 一、什么是平滑处理 1、平滑的目的是什么? 2、常见的图像噪声 (1)椒盐噪声 编辑(2) 高斯噪声 &a…...
【java面向对象编程】第七弹----Object类、类变量与类方法
笔上得来终觉浅,绝知此事要躬行 🔥 个人主页:星云爱编程 🔥 所属专栏:javase 🌷追光的人,终会万丈光芒 🎉欢迎大家点赞👍评论📝收藏⭐文章 目录 一、Object类 1.1equa…...
大模型微调---Prompt-tuning微调
目录 一、前言二、Prompt-tuning实战2.1、下载模型到本地2.2、加载模型与数据集2.3、处理数据2.4、Prompt-tuning微调2.5、训练参数配置2.6、开始训练 三、模型评估四、完整训练代码 一、前言 Prompt-tuning通过修改输入文本的提示(Prompt)来引导模型生…...
Connecting to Oracle 11g Database in Python
# encoding: utf-8 # 版权所有 2024 涂聚文有限公司 # 许可信息查看:言語成了邀功盡責的功臣,還需要行爲每日來值班嗎 # 描述:python -m pip install oracledb # python -m pip install cx_Oracle --upgrade # pip install cx_Oracle # Autho…...
16.2、网络安全风险评估技术与攻击
目录 网络安全风险评估技术方法与工具 网络安全风险评估技术方法与工具 资产信息收集,可以通过调查表的形式把我们各类的资产信息进行一个统计和收集,掌握被评估对象的重要资产分布,进而分析这些资产关联的业务面临的安全威胁以及存在的安全…...
Windows脚本清理C盘缓存
方法一:使用power文件.ps1的文件 脚本功能 清理临时文件夹: 当前用户的临时文件夹(%Temp%)。系统临时文件夹(C:\Windows\Temp)。 清理 Windows 更新缓存: 删除 Windows 更新下载缓存࿰…...