ValueError: unknown url type: 'adaseg-0.6.6-py3-none-any.whl.metadata’
当我希望使用modelscope加载模型进行推理的时候,产生了错误
我使用的命令如下:
from modelscope.pipelines import pipeline from modelscope.utils.constant import Tasks
p = pipeline(Tasks.named_entity_recognition, '/data3/huyan/liheng/tmp/AdaSeq/AdaSeq/experiments/eBay/231125005305.028950/output_best') result = p('Nike Reax TR Mesh Herren Sneaker low Turnschuhe Sportschuhe Freizeitschuhe')
print(result)
其中模型来自于使用AdaSeq训练的一个NER模型 (也是阿里开发的一个集成式模型训练包,可以在modelscope找到)
具体报错如下
2023-11-25 13:38:28,967 - modelscope - INFO - PyTorch version 2.1.1+cu118 Found.
2023-11-25 13:38:28,967 - modelscope - INFO - Loading ast index from /home/huyan/liheng/.cache/modelscope/ast_indexer
2023-11-25 13:38:29,079 - modelscope - INFO - Loading done! Current index file version is 1.9.5, with md5 c652a785900e4613e32639cfe65e325f and a total number of 945 components indexed
Traceback (most recent call last):
File "/data3/huyan/liheng/tmp/AdaSeq/AdaSeq/test.py", line 4, in
环境配置 OS:Linux ubuntu 20.04 CPU:Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz
检查发现 adaseq == 0.6.6 已经成功安装
@wenmengzhou @tastelikefeet @Firmament-cyou
damo/nlp_raner_named-entity-recognition_chinese-base-generic模型卡片上的微调及微调后推理没报错,modelscope1.9.5,adaseq0.6.6,transformers4.34.1,你用的模型是?
我使用的是U-raner,最后生成了一个output_best文件夹,具体文件如下
当时训练时使用的配置文件为
experiment:
exp_dir: experiments/
exp_name: eBay
seed: 42
task: named-entity-recognition
dataset: data_file: train: '/data3/huyan/liheng/tmp/AdaSeq/AdaSeq/dataset/eBay_4/train.txt' valid: '/data3/huyan/liheng/tmp/AdaSeq/AdaSeq/dataset/eBay_4/valid.txt' test: '/data3/huyan/liheng/tmp/AdaSeq/AdaSeq/dataset/eBay_4/test.txt' data_type: conll
preprocessor: type: sequence-labeling-preprocessor max_length: 1024 chunk_size: 256 chunk_num: 4
data_collator: SequenceLabelingDataCollatorWithPadding
model: type: sequence-labeling-model embedder: model_name_or_path: damo/nlp_raner_named-entity-recognition_multilingual-large-generic dropout: 0.1 use_crf: true chunk: true
train: max_epochs: 10 dataloader: batch_size_per_gpu: 8 optimizer: type: AdamW lr: 1.0e-5 param_groups: - regex: crf lr: 5.0e-2 options: cumulative_iters: 4 lr_scheduler: type: LinearLR start_factor: 1.0 end_factor: 0.0 total_iters: 30 hooks: - type: BestCkptSaverHook save_file_name: best_model.pth metric_key: macro-f1 save_optimizer: false restore_best: true
evaluation: dataloader: batch_size_per_gpu: 1 metrics: - type: ner-metric return_macro_f1: true - type: ner-dumper model_type: sequence_labeling dump_format: conll 当时参考的配置样例为 https://github.com/modelscope/AdaSeq/tree/master/examples/U-RaNER
发现是adaseq的问题,训练结束后生成的配置文件不匹配
本地测试,modelscope1.9.5,adaseq0.6.6,按damo/nlp_raner_named-entity-recognition_multilingual-large-generic模型卡片上代码微调,用微调之后的模型推理没有报错。
我也遇到了同样的问题,生成的配置文件不匹配,把旧的配置文件复制过去,但是输出很混乱,这个怎么解决的
请问这个问题解决了嘛?
damo/nlp_raner_named-entity-recognition_chinese-base-generic模型卡片上的微调及微调后推理没报错,modelscope1.9.5,adaseq0.6.6,transformers4.34.1,你用的模型是?
你好,我包的版本和你一致~
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.