- 博客(26)
- 收藏
- 关注
原创 jupyter代码丢失
jupyter写着写着就打不开这个文件了,然后就是文件中代码丢失,最近时间写的代码已经不见了,只有几个小时前的内容。的文件,可能会在C盘(这里可以使用快速搜索电脑文件的工具)用随便一个编辑器以utf-8解码打开,里面大概长这样。然后用残存的记忆大海捞针你的代码吧。
2024-07-17 15:51:37
173
原创 ImportError: cannot import name ‘DataError‘ from ‘pandas.core.base‘ (C:\Users\Ma\AppData\Roaming\Pyt
安装这两个包后再运行import pandas_profiling as ppf就不会报错了,但是pandas_profiling 上会出现横线。如果不想出现横线,将pandas_profiling 改为ydata_profiling即可。pandas_profiling包在2023.4.1已经被废弃,想要使用这个包不仅需要。将python3.11降为3.10(但是我没试过)
2024-06-03 17:14:47
287
原创 AttributeError: module ‘gradio‘ has no attribute ‘inputs‘
解决AttributeError: 'Dropdown' object has no attribute 'update'gradio版本不对。一开始用的版本是最新的4.26.0。把gradio版本降到3.41.0就不会报错了。
2024-04-17 11:03:47
825
1
原创 pip install git报错ERROR: Could not find a version that satisfies the requirement git
【代码】pip install git报错ERROR: Could not find a version that satisfies the requirement git。
2024-04-15 17:29:17
266
原创 Huggingface的Trainer类无法将日志写到logging文件中
在训练时想把这个信息也写到logging文件中。就可打印日志到日志文件中。
2024-01-11 10:50:53
776
3
原创 TypeError: ChatGLMPreTrainedModel._set_gradient_checkpointing() got an unexpected keyword argument ‘
transformers版本问题,改成4.34.0就不会报错了。
2024-01-03 15:02:53
476
原创 windows上bitsandbytes报错:AttributeError: module ‘bitsandbytes‘ has no attribute ‘nn‘
bitsandbytes版本不对。
2023-12-29 14:49:29
1417
原创 text-generation-webui加载codellama报错DLL load failed while importing flash_attn_2_cuda: 找不到指定的模块。
一开始排查是以为transformers的版本不对,先确定了transformers的版本,transformers的版本应该大于4.35.0。把transformers升级为4.35.0后仍然报错。最后发现是cuda版本与torch版本不匹配。接着排查cuda和torch的版本。最后加载成功codellama。
2023-12-01 11:10:18
4322
1
原创 踩坑日记8.21
2.pip install faiss一直报错ERROR: No matching distribution found for faiss,网上说这个包只有几个python的版本才能用,安装了3.7的python,还是no matching,后来才知道pip install faiss-cpu才对。1.pip安装包时忘记关科学上网,一直连接超时。3.大坑,没爬出来。
2023-08-21 16:46:22
197
原创 安装faiss报错ERROR: No matching distribution found for faiss
是pip install faiss-cpu。不是pip install faiss。
2023-08-21 14:35:46
603
原创 os.path.join()
os.path.join()函数功能:连接两个或更多的路径名组件如果各组件名首字母不包含’/’,则函数会自动加上如果有一个组件是一个绝对路径,则在它之前的所有组件均会被舍弃如果最后一个组件为空,则生成的路径以一个’/’分隔符结尾os.path.join()_谢军的博客-CSDN博客_os.path.join(...
2022-03-15 10:12:06
96
原创 assert()函数
函数名:assert()原型:void assert( int expression )功能:如果形参为假则终止程序参数:真或假 注意:每个assert只能检查一个条件,如果多个条件不好判断是哪个条件的错误具体:如果形参数为假,assert 向 stderr打印一条出错信息, 信息包含文件名、表达式、行号,然后调用abort终止程序 如果形参为真,程序继续执行优点:可以方便我们进行程序调试,同时对于绝对不能出错(条件为假)的地方使用可以有效的预防出现更多...
2022-03-15 09:47:31
196
原创 jupyter内核挂掉重启
解决jupyer“服务器似乎挂掉了,但是会立刻重启的”import osos.environ['KMP_DUPLICATE_LIB_OK']='True'
2022-03-07 20:32:03
717
2
原创 python计算机CPU使用时间
#该方法包含了其他程序使用CPU的时间,返回值是浮点数import timestart=time.time()#中间写上代码块end=time.time()print('Running time: %s Seconds'%(end-start))
2022-03-07 10:07:39
1064
原创 python把列表变成字符串
>>> a=["1","2","3","4","5"]#列表中的元素全是str类型>>>print(" ".join(a))#把列表中的元素放在空串了,并打印出空串中的内容12345
2022-03-04 10:07:18
406
原创 python判断是否为中文、中文符号、英文、英文符号
def is_Chinese(w): if '\u4e00' <= w <= '\u9fff': return Truedef is_zh_punctuation(w): punctuation_str = punctuation #中文符号 if w in punctuation_str: return Truedef is_en(w): if 'a'<=w<='z' or 'A'<=w<='Z'.
2022-03-03 17:57:50
4424
2
原创 itertools.permutations函数
几个数字的排列组合>>> import itertools>>> list(itertools.permutations([1,2,3], 3))[(1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)]>>> list(itertools.permutations([4,5,6], 3))[(4, 5, 6), (4, 6, 5), (5, 4, 6), (5,
2022-03-02 16:31:21
238
原创 论文阅读_
## QE论文阅读1.“Bilingual Expert” Can Find Translation Errorshttps://www.researchgate.net/publication/326621822_Bilingual_Expert_Can_Find_Translation_Errors2.TransQuest- Translation Quality Estimation with Cross-lingual Transformershttps://xueshu.baidu.co
2021-09-09 09:33:18
107
原创 qe实验----
目录先用sgm文件得到语料(见sgm文件的使用)处理语料:生成词表:先用sgm文件得到语料(见sgm文件的使用)处理语料:对训练集/验证集 train.en / dev.en: norm: perl tool/mosesdecoder/scripts/tokenizer/normalize-punctuation.perl -l en < data/train.en>data/train.norm.en to...
2021-07-15 16:00:40
337
原创 用qe模型跑的分析句子错误类型对认知难度的影响
处理语料从原语料中抽取出src,mt,时间,分别放在三个文件中。src和mt中的句子需要去掉标注时间需要归一化,归一化的方法:用每个时间除以时间中的最大值(用softmax归一化数值太小)已形成的src和mt都是顺序的,接下来需要打乱语料顺序最后模型需要的文件有:训练集:train.src train.mt train.mt.hter (一定要归一化!)测试集:test.src test.mt test.mt.hter(一定要归一化...
2021-07-09 10:23:41
159
原创 sgm文件用法
在TOOLS_PATH后给Mosh的地址改文件名字如果没有权限,cd到最tool文件夹里,执行chmod 777 -R Moses最后bash deal_smg.sh## Created by Jxu 2019-06-20 # Use Moses deal the '.smg' file#set -e## Data preprocessing configuration#N_MONO=10000000 # number of monolin...
2021-04-17 15:32:33
732
原创 re正则表达式模块
#正则的组成:#原子,元字符,模式修正符【其他语言中可能存在定界符】#基础知识'''#原子# 组成正则表达式的最小单位,一个正则表达式至少需要一个原子# 1所有可见字符都是原子:a,b,c,d...A,B,C,D...你,我,他...+-*/##@# 2所有不可见字符也是原子:\t \n \r ...# 3正则专用转义字符:# \d 表示0~9之间任意【一个】字符 ->[0123456789]自定义原子列表格式# \D 表示除了0~9之外的任意【一个】字符 .
2021-04-05 17:06:11
308
3
原创 ## Python笔记
安装python你的第一个python程序输出打印内容print("Mosh Hamedani")三 程序怎样运行画一只狗:代码:print('O----')print(' ||||')输出多个相同的字符:代码:print('*' * 10)四 variables 变量定义一个变量并输出代码:price = 10 ##整型rating = 4.9 ##浮点型name = 'Mosh' ##字符型is_published = False ##布尔
2020-07-20 15:30:40
322
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人