AdaSeq
AdaSeq copied to clipboard
[Question]
What is your question?
如何推理?
What have you tried?
训练模型之后自动就有了pred.txt,请问这个文件是在哪里生成的?
Code (if necessary)
No response
What's your environment?
- AdaSeq Version (e.g., 1.0 or master):
- ModelScope Version (e.g., 1.0 or master):
- PyTorch Version (e.g., 1.12.1):
- OS (e.g., Ubuntu 20.04):
- Python version:
- CUDA/cuDNN version:
- GPU models and configuration:
- Any other relevant information:
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
谢谢您的回答!!!不过在我训练脚本完成后,模型保存的文件是best_model.pth,请问修改哪里可以将模型的保存结果保存为modelscope的中模型格式(含有这些:config.json configuration.json pytorch_model.bin README.md resources vocab.txt)
谢谢您的回答!!!不过在我训练脚本完成后,模型保存的文件是best_model.pth,请问修改哪里可以将模型的保存结果保存为modelscope的中模型格式(含有这些:config.json configuration.json pytorch_model.bin README.md resources vocab.txt)
AdaSeq >= 0.6.0
刚刚支持这个功能,无须任何修改,训练完成后会生成output
或output_best
目录,这个目录和modelscope模型格式相同。
详见https://github.com/modelscope/AdaSeq/blob/master/docs/tutorials/model_inference_zh.md
我在使用这个推理的时候,遇到了ValueError: unknown url type: 'adaseq-0.6.6-py3-none-any.whl.metadata' 请问这个是怎么回事呢
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)
报错如下
2023-11-25 22:15:49,690 - modelscope - INFO - PyTorch version 2.1.1+cu118 Found.
2023-11-25 22:15:49,691 - modelscope - INFO - Loading ast index from /home/huyan/liheng/.cache/modelscope/ast_indexer
2023-11-25 22:15:49,788 - 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
但实际上我已经成功安装了 adaseq == 0.6.6
可以清空/data3/huyan/liheng/tmp/AdaSeq/AdaSeq/experiments/eBay/231125005305.028950/output_best/configuration.json最底下plugin的list中的内容,变成空list。但是运行可能还有其他问题。