-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: FileNotFoundError: configuration file<config.json> or <model_config.json> not found #4738
Comments
你好,我这边没有复现该问题。你这边需要确定下pip的python和运行程序的python是同一个。 |
确定是同一个版本,我在pycharm中控制台执行了pip list 命令行是可以看到的,工程的依赖包也可以看到。如果是缺包,正常应该会报出来啊 |
你自己改一下吧
改成
改成 PaddleNLP/paddlenlp/transformers/model_utils.py Line 1067 in e738349
改成 |
使用了 os.path.join 在 windows上拼接url的时候用的是 '', 导致发送requests请求的时候 404 了。 |
感谢 @caorushizi 和 @gcr1992 二位的反馈。这里确实我们写的逻辑有问题,导致windows用户出错。已在#4758 中fix, 合入之后应该可以解决问题 |
好的,该问题之前应该修复过 #3640,感谢大家的反馈! |
@iouen 当前这个PR正在升级pretrained config的,#4992 |
D:\Python>python finetune.py --device cpu --logging_steps 5 --save_steps 25 --eval_steps 25 --seed 42 --model_name_or_path uie-x-base --output_dir ./document/model_best --train_path document/data/train.txt --dev_path /document/data/dev.txt --per_device_train_batch_size 16 --per_device_eval_batch_size 16 --num_train_epochs 5 --learning_rate 1e-5 --label_names 'start_position' 'end_position' --do_train --do_eval --do_export --export_model_dir ./document/model_best --overwrite_output_dir --disable_tqdm True --metric_for_best_model eval_f1 --load_best_model_at_end True --save_total_limit 1 |
我也有同上的问题 |
I got the same error: |
I found that the error was caused by the use of the wrong finetune.py, it should be ./document/finetune.py, not ./text/finetune.py |
同样问题,拿不到对应的配置文件。 |
软件环境
重复问题
错误描述
稳定复现步骤 & 代码
1.安装
(1)从https://github.com/PaddlePaddle/PaddleNLP下载 develop 或者 v2.5.0 到本地window10机器
(2)pip uninstall -y paddlenlp
(3)进入 PaddleNLP解压目录 执行 python setup.py install
2.代码测试
from paddlenlp import Taskflow
prompt = "def lengthOfLongestSubstring(self, s: str) -> int:"
codegen = Taskflow("code_generation", model="Salesforce/codegen-350M-mono",decode_strategy="greedy_search", repetition_penalty=1.0)
print(codegen(prompt))
3.结果日志:
D:\Program Files\Python37\lib\site-packages_distutils_hack_init_.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
[2023-02-10 14:12:35,367] [ INFO] - Downloading https://bj.bcebos.com/paddlenlp/models/community//Salesforce/codegen-350M-mono/vocab.json and saved to C:\Users\gcr.paddlenlp\models\Salesforce/codegen-350M-mono
[2023-02-10 14:12:35,512] [ INFO] - Downloading vocab.json from https://bj.bcebos.com/paddlenlp/models/community//Salesforce/codegen-350M-mono/vocab.json
100%|██████████| 779k/779k [00:01<00:00, 773kB/s]
[2023-02-10 14:12:36,900] [ INFO] - Downloading https://bj.bcebos.com/paddlenlp/models/community//Salesforce/codegen-350M-mono/merges.txt and saved to C:\Users\gcr.paddlenlp\models\Salesforce/codegen-350M-mono
[2023-02-10 14:12:37,069] [ INFO] - Downloading merges.txt from https://bj.bcebos.com/paddlenlp/models/community//Salesforce/codegen-350M-mono/merges.txt
100%|██████████| 446k/446k [00:00<00:00, 562kB/s]
[2023-02-10 14:12:38,164] [ INFO] - Downloading https://bj.bcebos.com/paddlenlp/models/community//Salesforce/codegen-350M-mono/added_tokens.json and saved to C:\Users\gcr.paddlenlp\models\Salesforce/codegen-350M-mono
[2023-02-10 14:12:38,305] [ INFO] - Downloading added_tokens.json from https://bj.bcebos.com/paddlenlp/models/community//Salesforce/codegen-350M-mono/added_tokens.json
100%|██████████| 0.98k/0.98k [00:00<?, ?B/s]
[2023-02-10 14:12:38,429] [ INFO] - Downloading https://bj.bcebos.com/paddlenlp/models/community//Salesforce/codegen-350M-mono/special_tokens_map.json and saved to C:\Users\gcr.paddlenlp\models\Salesforce/codegen-350M-mono
[2023-02-10 14:12:38,561] [ INFO] - Downloading special_tokens_map.json from https://bj.bcebos.com/paddlenlp/models/community//Salesforce/codegen-350M-mono/special_tokens_map.json
100%|██████████| 90.0/90.0 [00:00<?, ?B/s]
[2023-02-10 14:12:38,708] [ INFO] - Downloading https://bj.bcebos.com/paddlenlp/models/community//Salesforce/codegen-350M-mono/tokenizer_config.json and saved to C:\Users\gcr.paddlenlp\models\Salesforce/codegen-350M-mono
[2023-02-10 14:12:38,831] [ INFO] - Downloading tokenizer_config.json from https://bj.bcebos.com/paddlenlp/models/community//Salesforce/codegen-350M-mono/tokenizer_config.json
100%|██████████| 177/177 [00:00<?, ?B/s]
[2023-02-10 14:12:39,008] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,008] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,008] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,008] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,008] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,008] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,008] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,008] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,008] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,008] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
[2023-02-10 14:12:39,024] [ INFO] - Adding to the vocabulary
Traceback (most recent call last):
File "F:/pythonProject/rpa/PaddleNLP/testCode.py", line 6, in
codegen = Taskflow("code_generation", model="Salesforce/codegen-350M-mono",decode_strategy="greedy_search", repetition_penalty=1.0)
File "D:\Program Files\Python37\lib\site-packages\paddlenlp\taskflow\taskflow.py", line 591, in init
model=self.model, task=self.task, priority_path=self.priority_path, from_hf_hub=from_hf_hub, **self.kwargs
File "D:\Program Files\Python37\lib\site-packages\paddlenlp\taskflow\code_generation.py", line 59, in init
self._construct_model(model)
File "D:\Program Files\Python37\lib\site-packages\paddlenlp\taskflow\code_generation.py", line 65, in _construct_model
self._model = CodeGenForCausalLM.from_pretrained(model)
File "D:\Program Files\Python37\lib\site-packages\paddlenlp\transformers\model_utils.py", line 486, in from_pretrained
pretrained_model_name_or_path, from_hf_hub=from_hf_hub, subfolder=subfolder, *args, **kwargs
File "D:\Program Files\Python37\lib\site-packages\paddlenlp\transformers\model_utils.py", line 1328, in from_pretrained_v2
**kwargs,
File "D:\Program Files\Python37\lib\site-packages\paddlenlp\transformers\configuration_utils.py", line 736, in from_pretrained
config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
File "D:\Program Files\Python37\lib\site-packages\paddlenlp\transformers\configuration_utils.py", line 758, in get_config_dict
config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
File "D:\Program Files\Python37\lib\site-packages\paddlenlp\transformers\configuration_utils.py", line 831, in _get_config_dict
raise FileNotFoundError(f"configuration file<{CONFIG_NAME}> or <{LEGACY_CONFIG_NAME}> not found")
FileNotFoundError: configuration file<config.json> or <model_config.json> not found
The text was updated successfully, but these errors were encountered: