thomas-yanxin / Paddle-ChatDocuments

Apache License 2.0
35 stars 6 forks source link

运行python chat_documents.py出错 #5

Open robertoding opened 1 year ago

robertoding commented 1 year ago

代码未作修改直接运行。环境python3.9, paddlepaddle, paddlenlp, paddle-pipelines均为最新版。Windows11专业版

DEBUG - matplotlib - matplotlib data path: C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\matplotlib\mpl-data DEBUG - matplotlib - CONFIGDIR=C:\Users\rober.matplotlib DEBUG - matplotlib - interactive is False DEBUG - matplotlib - platform is win32 DEBUG - matplotlib - CACHEDIR=C:\Users\rober.matplotlib DEBUG - matplotlib.font_manager - Using fontManager instance from C:\Users\rober.matplotlib\fontlist-v330.json DEBUG - urllib3.connectionpool - Starting new HTTP connection (1): paddlepaddle.org.cn:80 DEBUG - urllib3.connectionpool - http://paddlepaddle.org.cn:80 "GET /paddlehub/stat?word=text_generation-THUDM%2Fchatglm-6b-v1.1&hub_version=+&ppnlp_version=2.5.2.post&paddle_version=2.4.2&from=ppnlp&extra=%7B%22command%22%3A+%22taskflow%22%2C+%22mtime%22%3A+%222023-06-26+22%3A01%3A31%22%2C+%22hub_name%22%3A+%22f0697f8521c3fff72b089934e478f8f2-1687788091%22%2C+%22cache_info%22%3A+%22e67c5b76d63766c412272803c2b15ec5%22%7D HTTP/1.1" 301 186 DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): paddlepaddle.org.cn:443 DEBUG - urllib3.connectionpool - https://paddlepaddle.org.cn:443 "GET /paddlehub/stat?word=text_generation-THUDM%2Fchatglm-6b-v1.1&hub_version=+&ppnlp_version=2.5.2.post&paddle_version=2.4.2&from=ppnlp&extra=%7B%22command%22%3A+%22taskflow%22%2C+%22mtime%22%3A+%222023-06-26+22%3A01%3A31%22%2C+%22hub_name%22%3A+%22f0697f8521c3fff72b089934e478f8f2-1687788091%22%2C+%22cache_info%22%3A+%22e67c5b76d63766c412272803c2b15ec5%22%7D HTTP/1.1" 200 13 [2023-06-26 22:01:31,245] [ INFO] - Already cached C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1\ice_text.model [2023-06-26 22:01:31,245] [ INFO] - Downloading https://bj.bcebos.com/paddlenlp/models/community/THUDM/chatglm-6b-v1.1/added_tokens.json and saved to C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1 DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): bj.bcebos.com:443 DEBUG - urllib3.connectionpool - https://bj.bcebos.com:443 "HEAD /paddlenlp/models/community/THUDM/chatglm-6b-v1.1/added_tokens.json HTTP/1.1" 404 0 [2023-06-26 22:01:31,415] [ WARNING] - filehttps://bj.bcebos.com/paddlenlp/models/community/THUDM/chatglm-6b-v1.1/added_tokens.json not exist [2023-06-26 22:01:31,415] [ INFO] - Downloading https://bj.bcebos.com/paddlenlp/models/community/THUDM/chatglm-6b-v1.1/special_tokens_map.json and saved to C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1 DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): bj.bcebos.com:443 DEBUG - urllib3.connectionpool - https://bj.bcebos.com:443 "HEAD /paddlenlp/models/community/THUDM/chatglm-6b-v1.1/special_tokens_map.json HTTP/1.1" 404 0 [2023-06-26 22:01:31,533] [ WARNING] - filehttps://bj.bcebos.com/paddlenlp/models/community/THUDM/chatglm-6b-v1.1/special_tokens_map.json not exist [2023-06-26 22:01:31,533] [ INFO] - Already cached C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1\tokenizer_config.json DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): bj.bcebos.com:443 DEBUG - urllib3.connectionpool - https://bj.bcebos.com:443 "HEAD /paddlenlp/models/community/THUDM/chatglm-6b-v1.1/config.json HTTP/1.1" 200 0 DEBUG - filelock - Attempting to acquire lock 1603553788400 on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\049c4e5d3cd71ad91e3afebdd5e9e5e0 DEBUG - filelock - Lock 1603553788400 acquired on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\049c4e5d3cd71ad91e3afebdd5e9e5e0 [2023-06-26 22:01:31,783] [ INFO] - Found C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1\config.json DEBUG - filelock - Attempting to release lock 1603553788400 on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\049c4e5d3cd71ad91e3afebdd5e9e5e0 DEBUG - filelock - Lock 1603553788400 released on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\049c4e5d3cd71ad91e3afebdd5e9e5e0 [2023-06-26 22:01:31,786] [ INFO] - loading configuration file C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1\config.json [2023-06-26 22:01:31,787] [ INFO] - Model config ChatGLMConfig { "_name_or_path": "THUDM/chatglm-6b", "activation": "gelu", "architectures": [ "ChatGLMModel" ], "attention_scale": true, "auto_map": { "AutoConfig": "configuration_chatglm.ChatGLMConfig", "AutoModel": "modeling_chatglm.ChatGLMForConditionalGeneration", "AutoModelForSeq2SeqLM": "modeling_chatglm.ChatGLMForConditionalGeneration" }, "bos_token_id": 130004, "dtype": "float16", "eos_token_id": 130005, "gmask_token_id": 130001, "hidden_size": 4096, "inner_hidden_size": 16384, "layernorm_epsilon": 1e-05, "mask_token_id": 130000, "max_sequence_length": 2048, "model_type": "chatglm", "num_attention_heads": 32, "num_hidden_layers": 28, "num_image_tokens": 0, "output_predict": true, "pad_token_id": 3, "paddlenlp_version": null, "position_encoding_2d": true, "pre_seq_len": null, "prefix_projection": false, "quantization_bit": 0, "recompute": false, "transformers_version": "4.23.1", "use_cache": true, "vocab_size": 130528 }

DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): bj.bcebos.com:443 DEBUG - urllib3.connectionpool - https://bj.bcebos.com:443 "HEAD /paddlenlp/models/community/THUDM/chatglm-6b-v1.1/model_state.pdparams HTTP/1.1" 200 0 DEBUG - filelock - Attempting to acquire lock 1602715223856 on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\9bd4dd135892f4316175f2abc60cc621 DEBUG - filelock - Lock 1602715223856 acquired on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\9bd4dd135892f4316175f2abc60cc621 [2023-06-26 22:01:31,920] [ INFO] - Found C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1\model_state.pdparams DEBUG - filelock - Attempting to release lock 1602715223856 on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\9bd4dd135892f4316175f2abc60cc621 DEBUG - filelock - Lock 1602715223856 released on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\9bd4dd135892f4316175f2abc60cc621 DEBUG - urllib3.connectionpool - Starting new HTTP connection (1): paddlepaddle.org.cn:80 DEBUG - urllib3.connectionpool - http://paddlepaddle.org.cn:80 "GET /paddlehub/stat?word=https%3A%2F%2Fbj.bcebos.com%2Fpaddlenlp%2Fmodels%2Fcommunity%2FTHUDM%2Fchatglm-6b-v1.1%2Fmodel_state.pdparams&hub_version=+&ppnlp_version=2.5.2.post&paddle_version=2.4.2&from=ppnlp&extra=%7B%22command%22%3A+%22from_pretrained_v2%22%2C+%22mtime%22%3A+%222023-06-26+22%3A01%3A31%22%2C+%22hub_name%22%3A+%22f0697f8521c3fff72b089934e478f8f2-1687788091%22%2C+%22cache_info%22%3A+%22e67c5b76d63766c412272803c2b15ec5%22%7D HTTP/1.1" 301 186 DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): paddlepaddle.org.cn:443 DEBUG - urllib3.connectionpool - https://paddlepaddle.org.cn:443 "GET /paddlehub/stat?word=https%3A%2F%2Fbj.bcebos.com%2Fpaddlenlp%2Fmodels%2Fcommunity%2FTHUDM%2Fchatglm-6b-v1.1%2Fmodel_state.pdparams&hub_version=+&ppnlp_version=2.5.2.post&paddle_version=2.4.2&from=ppnlp&extra=%7B%22command%22%3A+%22from_pretrained_v2%22%2C+%22mtime%22%3A+%222023-06-26+22%3A01%3A31%22%2C+%22hub_name%22%3A+%22f0697f8521c3fff72b089934e478f8f2-1687788091%22%2C+%22cache_info%22%3A+%22e67c5b76d63766c412272803c2b15ec5%22%7D HTTP/1.1" 200 13 W0626 22:01:39.500463 26988 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 8.9, Driver API Version: 12.2, Runtime API Version: 11.7 W0626 22:01:39.502465 26988 gpu_resources.cc:91] device: 0, cuDNN Version: 8.7. [2023-06-26 22:01:44,530] [ WARNING] - Some weights of the model checkpoint at THUDM/chatglm-6b-v1.1 were not used when initializing ChatGLMForConditionalGeneration: ['transformer.layers.3.attention.rotary_emb.inv_freq', 'transformer.layers.10.attention.rotary_emb.inv_freq', 'transformer.layers.26.attention.rotary_emb.inv_freq', 'transformer.layers.0.attention.rotary_emb.inv_freq', 'transformer.layers.18.attention.rotary_emb.inv_freq', 'transformer.layers.20.attention.rotary_emb.inv_freq', 'transformer.layers.8.attention.rotary_emb.inv_freq', 'transformer.layers.21.attention.rotary_emb.inv_freq', 'transformer.layers.12.attention.rotary_emb.inv_freq', 'transformer.layers.24.attention.rotary_emb.inv_freq', 'transformer.layers.15.attention.rotary_emb.inv_freq', 'transformer.layers.2.attention.rotary_emb.inv_freq', 'transformer.layers.13.attention.rotary_emb.inv_freq', 'transformer.layers.11.attention.rotary_emb.inv_freq', 'transformer.layers.4.attention.rotary_emb.inv_freq', 'transformer.layers.23.attention.rotary_emb.inv_freq', 'transformer.layers.6.attention.rotary_emb.inv_freq', 'transformer.layers.7.attention.rotary_emb.inv_freq', 'transformer.layers.1.attention.rotary_emb.inv_freq', 'transformer.layers.27.attention.rotary_emb.inv_freq', 'transformer.layers.14.attention.rotary_emb.inv_freq', 'transformer.layers.5.attention.rotary_emb.inv_freq', 'transformer.layers.25.attention.rotary_emb.inv_freq', 'transformer.layers.22.attention.rotary_emb.inv_freq', 'transformer.layers.16.attention.rotary_emb.inv_freq', 'transformer.layers.9.attention.rotary_emb.inv_freq', 'transformer.layers.19.attention.rotary_emb.inv_freq', 'transformer.layers.17.attention.rotary_emb.inv_freq']

[2023-06-26 22:01:45,492] [ INFO] - Configuration saved in C:\Users\rober.paddlenlp\models\rocketqa-zh-base-query-encoder\config.json DEBUG - filelock - Attempting to acquire lock 1602756939200 on C:\Users\rober.paddlenlp\models\rocketqa-zh-base-query-encoder.lock\3063e2023c4570a8b9379c696007bd2e DEBUG - filelock - Lock 1602756939200 acquired on C:\Users\rober.paddlenlp\models\rocketqa-zh-base-query-encoder.lock\3063e2023c4570a8b9379c696007bd2e [2023-06-26 22:01:45,493] [ INFO] - Downloading rocketqa-zh-base-query-encoder.pdparams from https://paddlenlp.bj.bcebos.com/models/transformers/rocketqa/rocketqa-zh-base-query-encoder.pdparams DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): paddlenlp.bj.bcebos.com:443 DEBUG - urllib3.connectionpool - https://paddlenlp.bj.bcebos.com:443 "GET /models/transformers/rocketqa/rocketqa-zh-base-query-encoder.pdparams HTTP/1.1" 200 471806393 100%|███████████████████████████████████████████████████████████████████████████████| 450M/450M [00:11<00:00, 40.2MB/s] DEBUG - filelock - Attempting to release lock 1602756939200 on C:\Users\rober.paddlenlp\models\rocketqa-zh-base-query-encoder.lock\3063e2023c4570a8b9379c696007bd2e DEBUG - filelock - Lock 1602756939200 released on C:\Users\rober.paddlenlp\models\rocketqa-zh-base-query-encoder.lock\3063e2023c4570a8b9379c696007bd2e [2023-06-26 22:01:58,230] [ INFO] - All model checkpoint weights were used when initializing ErnieEncoder.

[2023-06-26 22:01:58,230] [ WARNING] - Some weights of ErnieEncoder were not initialized from the model checkpoint at rocketqa-zh-base-query-encoder and are newly initialized: ['emb_reduce_linear.bias', 'emb_reduce_linear.weight'] You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference. [2023-06-26 22:01:58,231] [ INFO] - Converting to the inference model cost a little time. [2023-06-26 22:02:00,470] [ INFO] - The inference model save in the path:C:\Users\rober.paddlenlp\taskflow\rocketqa-zh-base-query-encoder\static\inference [2023-06-26 22:02:02,569] [ INFO] - We are using (<class 'paddlenlp.transformers.ernie.tokenizer.ErnieTokenizer'>, False) to load 'rocketqa-zh-base-query-encoder'. [2023-06-26 22:02:02,569] [ INFO] - Already cached C:\Users\rober.paddlenlp\models\rocketqa-zh-base-query-encoder\ernie_3.0_base_zh_vocab.txt [2023-06-26 22:02:02,580] [ INFO] - tokenizer config file saved in C:\Users\rober.paddlenlp\models\rocketqa-zh-base-query-encoder\tokenizer_config.json [2023-06-26 22:02:02,580] [ INFO] - Special tokens file saved in C:\Users\rober.paddlenlp\models\rocketqa-zh-base-query-encoder\special_tokens_map.json download https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar to C:\Users\rober/.paddleocr/whl\cls\ch_ppocr_mobile_v2.0_cls_infer\ch_ppocr_mobile_v2.0_cls_infer.tar DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): paddleocr.bj.bcebos.com:443 DEBUG - urllib3.connectionpool - https://paddleocr.bj.bcebos.com:443 "GET /dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar HTTP/1.1" 200 2188800 100%|████████████████████████████████████████████████████████████████████████████| 2.19M/2.19M [00:00<00:00, 2.71MiB/s] [2023/06/26 22:02:05] ppocr DEBUG: Namespace(help='==SUPPRESS==', use_gpu=True, use_xpu=False, ir_optim=True, use_tensorrt=False, min_subgraph_size=15, shape_info_filename=None, precision='fp32', gpu_mem=500, image_dir=None, det_algorithm='DB', det_model_dir='C:\Users\rober/.paddleocr/whl\det\ch\ch_PP-OCRv3_det_infer', det_limit_side_len=960, det_limit_type='max', det_db_thresh=0.3, det_db_box_thresh=0.6, det_db_unclip_ratio=1.5, max_batch_size=10, use_dilation=False, det_db_score_mode='fast', det_east_score_thresh=0.8, det_east_cover_thresh=0.1, det_east_nms_thresh=0.2, det_sast_score_thresh=0.5, det_sast_nms_thresh=0.2, det_sast_polygon=False, det_pse_thresh=0, det_pse_box_thresh=0.85, det_pse_min_area=16, det_pse_box_type='quad', det_pse_scale=1, scales=[8, 16, 32], alpha=1.0, beta=1.0, fourier_degree=5, det_fce_box_type='poly', rec_algorithm='SVTR_LCNet', rec_model_dir='C:\Users\rober/.paddleocr/whl\rec\ch\ch_PP-OCRv3_rec_infer', rec_image_shape='3, 48, 320', rec_batch_num=6, max_text_length=25, rec_char_dict_path='C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\paddleocr\ppocr\utils\ppocr_keys_v1.txt', use_space_char=True, vis_font_path='./doc/fonts/simfang.ttf', drop_score=0.5, e2e_algorithm='PGNet', e2e_model_dir=None, e2e_limit_side_len=768, e2e_limit_type='max', e2e_pgnet_score_thresh=0.5, e2e_char_dict_path='./ppocr/utils/ic15_dict.txt', e2e_pgnet_valid_set='totaltext', e2e_pgnet_mode='fast', use_angle_cls=True, cls_model_dir='C:\Users\rober/.paddleocr/whl\cls\ch_ppocr_mobile_v2.0_cls_infer', cls_image_shape='3, 48, 192', label_list=['0', '180'], cls_batch_num=6, cls_thresh=0.9, enable_mkldnn=False, cpu_threads=10, use_pdserving=False, warmup=False, sr_model_dir=None, sr_image_shape='3, 32, 128', sr_batch_num=1, draw_img_save_dir='./inference_results', save_crop_res=False, crop_res_save_dir='./output', use_mp=False, total_process_num=1, process_id=0, benchmark=False, save_log_path='./log_output/', show_log=True, use_onnx=False, output='./output', table_max_len=488, table_algorithm='TableAttn', table_model_dir=None, merge_no_span_structure=True, table_char_dict_path=None, layout_model_dir=None, layout_dict_path=None, layout_score_threshold=0.5, layout_nms_threshold=0.5, kie_algorithm='LayoutXLM', ser_model_dir=None, ser_dict_path='../train_data/XFUND/class_list_xfun.txt', ocr_order_method=None, mode='structure', image_orientation=False, layout=True, table=True, ocr=True, recovery=False, save_pdf=False, lang='ch', det=True, rec=True, type='ocr', ocr_version='PP-OCRv3', structure_version='PP-Structurev2') INFO - pipelines.utils.common_utils - Using devices: PLACE(GPU:0) INFO - pipelines.utils.common_utils - Number of GPUs: 1 Loading Parameters from:rocketqa-zh-dureader-cross-encoder [2023-06-26 22:02:08,020] [ INFO] - Downloading model_state.pdparams from https://paddlenlp.bj.bcebos.com/taskflow/text_similarity/rocketqa-zh-dureader-cross-encoder/model_state.pdparams DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): paddlenlp.bj.bcebos.com:443 DEBUG - urllib3.connectionpool - https://paddlenlp.bj.bcebos.com:443 "GET /taskflow/text_similarity/rocketqa-zh-dureader-cross-encoder/model_state.pdparams HTTP/1.1" 200 399491407 100%|███████████████████████████████████████████████████████████████████████████████| 381M/381M [00:13<00:00, 28.7MB/s] [2023-06-26 22:02:23,154] [ INFO] - Downloading model_config.json from https://paddlenlp.bj.bcebos.com/taskflow/text_similarity/rocketqa-zh-dureader-cross-encoder/model_config.json DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): paddlenlp.bj.bcebos.com:443 DEBUG - urllib3.connectionpool - https://paddlenlp.bj.bcebos.com:443 "GET /taskflow/text_similarity/rocketqa-zh-dureader-cross-encoder/model_config.json HTTP/1.1" 200 485 100%|██████████████████████████████████████████████████████████████████████████████████| 485/485 [00:00<00:00, 243kB/s] [2023-06-26 22:02:23,297] [ INFO] - loading configuration file C:\Users\rober.paddlenlp\taskflow\text_similarity\rocketqa-zh-dureader-cross-encoder\model_config.json [2023-06-26 22:02:23,298] [ INFO] - Model config ErnieConfig { "architectures": [ "ErnieForSequenceClassification" ], "attention_probs_dropout_prob": 0.1, "enable_recompute": false, "fuse": false, "hidden_act": "relu", "hidden_dropout_prob": 0.1, "hidden_size": 768, "initializer_range": 0.02, "intermediate_size": 3072, "layer_norm_eps": 1e-12, "max_position_embeddings": 513, "model_type": "ernie", "num_attention_heads": 12, "num_hidden_layers": 12, "pad_token_id": 0, "paddlenlp_version": null, "pool_act": "tanh", "task_id": 0, "task_type_vocab_size": 3, "type_vocab_size": 2, "use_task_id": false, "vocab_size": 18000 }

[2023-06-26 22:02:23,300] [ INFO] - Configuration saved in C:\Users\rober.paddlenlp\taskflow\text_similarity\rocketqa-zh-dureader-cross-encoder\config.json [2023-06-26 22:02:24,185] [ INFO] - All model checkpoint weights were used when initializing ErnieEncoder.

[2023-06-26 22:02:24,185] [ INFO] - All the weights of ErnieEncoder were initialized from the model checkpoint at C:\Users\rober.paddlenlp\taskflow\text_similarity\rocketqa-zh-dureader-cross-encoder. If your task is similar to the task the model of the checkpoint was trained on, you can already use ErnieEncoder for predictions without further training. [2023-06-26 22:02:24,186] [ INFO] - Converting to the inference model cost a little time. [2023-06-26 22:02:27,037] [ INFO] - The inference model save in the path:C:\Users\rober.paddlenlp\taskflow\text_similarity\rocketqa-zh-dureader-cross-encoder\static\inference [2023-06-26 22:02:30,884] [ INFO] - Downloading https://bj.bcebos.com/paddlenlp/models/transformers/rocketqa/rocketqa-zh-dureader-vocab.txt and saved to C:\Users\rober.paddlenlp\models\rocketqa-zh-dureader-cross-encoder DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): bj.bcebos.com:443 DEBUG - urllib3.connectionpool - https://bj.bcebos.com:443 "HEAD /paddlenlp/models/transformers/rocketqa/rocketqa-zh-dureader-vocab.txt HTTP/1.1" 200 0 DEBUG - filelock - Attempting to acquire lock 1605665445008 on C:\Users\rober.paddlenlp\models\rocketqa-zh-dureader-cross-encoder.lock\c71bf2a4a795eeb6ccc2ee7d2f115ad7 DEBUG - filelock - Lock 1605665445008 acquired on C:\Users\rober.paddlenlp\models\rocketqa-zh-dureader-cross-encoder.lock\c71bf2a4a795eeb6ccc2ee7d2f115ad7 [2023-06-26 22:02:31,066] [ INFO] - Downloading rocketqa-zh-dureader-vocab.txt from https://bj.bcebos.com/paddlenlp/models/transformers/rocketqa/rocketqa-zh-dureader-vocab.txt DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): bj.bcebos.com:443 DEBUG - urllib3.connectionpool - https://bj.bcebos.com:443 "GET /paddlenlp/models/transformers/rocketqa/rocketqa-zh-dureader-vocab.txt HTTP/1.1" 200 91107 100%|██████████████████████████████████████████████████████████████████████████████| 89.0k/89.0k [00:00<00:00, 991kB/s] DEBUG - filelock - Attempting to release lock 1605665445008 on C:\Users\rober.paddlenlp\models\rocketqa-zh-dureader-cross-encoder.lock\c71bf2a4a795eeb6ccc2ee7d2f115ad7 DEBUG - filelock - Lock 1605665445008 released on C:\Users\rober.paddlenlp\models\rocketqa-zh-dureader-cross-encoder.lock\c71bf2a4a795eeb6ccc2ee7d2f115ad7 [2023-06-26 22:02:31,333] [ INFO] - tokenizer config file saved in C:\Users\rober.paddlenlp\models\rocketqa-zh-dureader-cross-encoder\tokenizer_config.json [2023-06-26 22:02:31,334] [ INFO] - Special tokens file saved in C:\Users\rober.paddlenlp\models\rocketqa-zh-dureader-cross-encoder\special_tokens_map.json Traceback (most recent call last): File "D:\Development\AI_Projects\Paddle-ChatDocuments\chat_documents.py", line 276, in chatglm_documents.chatglm_bot('chatglm-6b的局限性在哪里?如何改进?', File "D:\Development\AI_Projects\Paddle-ChatDocuments\chat_documents.py", line 228, in chatglm_bot pipe.add_node(component=self.ranker, AttributeError: 'ChatGLM_documents' object has no attribute 'ranker'

(paddle) D:\Development\AI_Projects\Paddle-ChatDocuments>python chat_documents.py C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\pkg_resources__init.py:121: DeprecationWarning: pkg_resources is deprecated as an API warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning) C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\pkg_resources__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('mpl_toolkits'). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\pkg_resources__init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('google'). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\pkg_resources\init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('zope'). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) C:\Users\rober\miniconda3\envs\paddle\lib\site-packages_distutils_hack\init__.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") DEBUG - matplotlib - matplotlib data path: C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\matplotlib\mpl-data DEBUG - matplotlib - CONFIGDIR=C:\Users\rober.matplotlib DEBUG - matplotlib - interactive is False DEBUG - matplotlib - platform is win32 DEBUG - matplotlib - CACHEDIR=C:\Users\rober.matplotlib DEBUG - matplotlib.font_manager - Using fontManager instance from C:\Users\rober.matplotlib\fontlist-v330.json DEBUG - urllib3.connectionpool - Starting new HTTP connection (1): paddlepaddle.org.cn:80 DEBUG - urllib3.connectionpool - http://paddlepaddle.org.cn:80 "GET /paddlehub/stat?word=text_generation-THUDM%2Fchatglm-6b-v1.1&hub_version=+&ppnlp_version=2.5.2.post&paddle_version=2.4.2&from=ppnlp&extra=%7B%22command%22%3A+%22taskflow%22%2C+%22mtime%22%3A+%222023-06-26+22%3A09%3A58%22%2C+%22hub_name%22%3A+%224be35812610f57e146182e1a9aac781b-1687788598%22%2C+%22cache_info%22%3A+%22e67c5b76d63766c412272803c2b15ec5%22%7D HTTP/1.1" 301 186 DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): paddlepaddle.org.cn:443 DEBUG - urllib3.connectionpool - https://paddlepaddle.org.cn:443 "GET /paddlehub/stat?word=text_generation-THUDM%2Fchatglm-6b-v1.1&hub_version=+&ppnlp_version=2.5.2.post&paddle_version=2.4.2&from=ppnlp&extra=%7B%22command%22%3A+%22taskflow%22%2C+%22mtime%22%3A+%222023-06-26+22%3A09%3A58%22%2C+%22hub_name%22%3A+%224be35812610f57e146182e1a9aac781b-1687788598%22%2C+%22cache_info%22%3A+%22e67c5b76d63766c412272803c2b15ec5%22%7D HTTP/1.1" 200 13 [2023-06-26 22:09:58,803] [ INFO] - Already cached C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1\ice_text.model [2023-06-26 22:09:58,803] [ INFO] - Downloading https://bj.bcebos.com/paddlenlp/models/community/THUDM/chatglm-6b-v1.1/added_tokens.json and saved to C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1 DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): bj.bcebos.com:443 DEBUG - urllib3.connectionpool - https://bj.bcebos.com:443 "HEAD /paddlenlp/models/community/THUDM/chatglm-6b-v1.1/added_tokens.json HTTP/1.1" 404 0 [2023-06-26 22:09:58,967] [ WARNING] - filehttps://bj.bcebos.com/paddlenlp/models/community/THUDM/chatglm-6b-v1.1/added_tokens.json not exist [2023-06-26 22:09:58,968] [ INFO] - Downloading https://bj.bcebos.com/paddlenlp/models/community/THUDM/chatglm-6b-v1.1/special_tokens_map.json and saved to C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1 DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): bj.bcebos.com:443 DEBUG - urllib3.connectionpool - https://bj.bcebos.com:443 "HEAD /paddlenlp/models/community/THUDM/chatglm-6b-v1.1/special_tokens_map.json HTTP/1.1" 404 0 [2023-06-26 22:09:59,105] [ WARNING] - filehttps://bj.bcebos.com/paddlenlp/models/community/THUDM/chatglm-6b-v1.1/special_tokens_map.json not exist [2023-06-26 22:09:59,105] [ INFO] - Already cached C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1\tokenizer_config.json DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): bj.bcebos.com:443 DEBUG - urllib3.connectionpool - https://bj.bcebos.com:443 "HEAD /paddlenlp/models/community/THUDM/chatglm-6b-v1.1/config.json HTTP/1.1" 200 0 DEBUG - filelock - Attempting to acquire lock 2501928354288 on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\049c4e5d3cd71ad91e3afebdd5e9e5e0 DEBUG - filelock - Lock 2501928354288 acquired on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\049c4e5d3cd71ad91e3afebdd5e9e5e0 [2023-06-26 22:09:59,361] [ INFO] - Found C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1\config.json DEBUG - filelock - Attempting to release lock 2501928354288 on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\049c4e5d3cd71ad91e3afebdd5e9e5e0 DEBUG - filelock - Lock 2501928354288 released on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\049c4e5d3cd71ad91e3afebdd5e9e5e0 [2023-06-26 22:09:59,364] [ INFO] - loading configuration file C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1\config.json [2023-06-26 22:09:59,365] [ INFO] - Model config ChatGLMConfig { "_name_or_path": "THUDM/chatglm-6b", "activation": "gelu", "architectures": [ "ChatGLMModel" ], "attention_scale": true, "auto_map": { "AutoConfig": "configuration_chatglm.ChatGLMConfig", "AutoModel": "modeling_chatglm.ChatGLMForConditionalGeneration", "AutoModelForSeq2SeqLM": "modeling_chatglm.ChatGLMForConditionalGeneration" }, "bos_token_id": 130004, "dtype": "float16", "eos_token_id": 130005, "gmask_token_id": 130001, "hidden_size": 4096, "inner_hidden_size": 16384, "layernorm_epsilon": 1e-05, "mask_token_id": 130000, "max_sequence_length": 2048, "model_type": "chatglm", "num_attention_heads": 32, "num_hidden_layers": 28, "num_image_tokens": 0, "output_predict": true, "pad_token_id": 3, "paddlenlp_version": null, "position_encoding_2d": true, "pre_seq_len": null, "prefix_projection": false, "quantization_bit": 0, "recompute": false, "transformers_version": "4.23.1", "use_cache": true, "vocab_size": 130528 }

DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): bj.bcebos.com:443 DEBUG - urllib3.connectionpool - https://bj.bcebos.com:443 "HEAD /paddlenlp/models/community/THUDM/chatglm-6b-v1.1/model_state.pdparams HTTP/1.1" 200 0 DEBUG - filelock - Attempting to acquire lock 2503236888416 on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\9bd4dd135892f4316175f2abc60cc621 DEBUG - filelock - Lock 2503236888416 acquired on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\9bd4dd135892f4316175f2abc60cc621 [2023-06-26 22:09:59,526] [ INFO] - Found C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1\model_state.pdparams DEBUG - filelock - Attempting to release lock 2503236888416 on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\9bd4dd135892f4316175f2abc60cc621 DEBUG - filelock - Lock 2503236888416 released on C:\Users\rober.paddlenlp\models\THUDM/chatglm-6b-v1.1.lock\9bd4dd135892f4316175f2abc60cc621 DEBUG - urllib3.connectionpool - Starting new HTTP connection (1): paddlepaddle.org.cn:80 DEBUG - urllib3.connectionpool - http://paddlepaddle.org.cn:80 "GET /paddlehub/stat?word=https%3A%2F%2Fbj.bcebos.com%2Fpaddlenlp%2Fmodels%2Fcommunity%2FTHUDM%2Fchatglm-6b-v1.1%2Fmodel_state.pdparams&hub_version=+&ppnlp_version=2.5.2.post&paddle_version=2.4.2&from=ppnlp&extra=%7B%22command%22%3A+%22from_pretrained_v2%22%2C+%22mtime%22%3A+%222023-06-26+22%3A09%3A59%22%2C+%22hub_name%22%3A+%224be35812610f57e146182e1a9aac781b-1687788599%22%2C+%22cache_info%22%3A+%22e67c5b76d63766c412272803c2b15ec5%22%7D HTTP/1.1" 301 186 DEBUG - urllib3.connectionpool - Starting new HTTPS connection (1): paddlepaddle.org.cn:443 DEBUG - urllib3.connectionpool - https://paddlepaddle.org.cn:443 "GET /paddlehub/stat?word=https%3A%2F%2Fbj.bcebos.com%2Fpaddlenlp%2Fmodels%2Fcommunity%2FTHUDM%2Fchatglm-6b-v1.1%2Fmodel_state.pdparams&hub_version=+&ppnlp_version=2.5.2.post&paddle_version=2.4.2&from=ppnlp&extra=%7B%22command%22%3A+%22from_pretrained_v2%22%2C+%22mtime%22%3A+%222023-06-26+22%3A09%3A59%22%2C+%22hub_name%22%3A+%224be35812610f57e146182e1a9aac781b-1687788599%22%2C+%22cache_info%22%3A+%22e67c5b76d63766c412272803c2b15ec5%22%7D HTTP/1.1" 200 13 W0626 22:10:03.274555 26616 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 8.9, Driver API Version: 12.2, Runtime API Version: 11.7 W0626 22:10:03.277556 26616 gpu_resources.cc:91] device: 0, cuDNN Version: 8.7. [2023-06-26 22:10:07,439] [ WARNING] - Some weights of the model checkpoint at THUDM/chatglm-6b-v1.1 were not used when initializing ChatGLMForConditionalGeneration: ['transformer.layers.16.attention.rotary_emb.inv_freq', 'transformer.layers.11.attention.rotary_emb.inv_freq', 'transformer.layers.17.attention.rotary_emb.inv_freq', 'transformer.layers.15.attention.rotary_emb.inv_freq', 'transformer.layers.25.attention.rotary_emb.inv_freq', 'transformer.layers.8.attention.rotary_emb.inv_freq', 'transformer.layers.21.attention.rotary_emb.inv_freq', 'transformer.layers.3.attention.rotary_emb.inv_freq', 'transformer.layers.19.attention.rotary_emb.inv_freq', 'transformer.layers.26.attention.rotary_emb.inv_freq', 'transformer.layers.10.attention.rotary_emb.inv_freq', 'transformer.layers.27.attention.rotary_emb.inv_freq', 'transformer.layers.2.attention.rotary_emb.inv_freq', 'transformer.layers.13.attention.rotary_emb.inv_freq', 'transformer.layers.23.attention.rotary_emb.inv_freq', 'transformer.layers.4.attention.rotary_emb.inv_freq', 'transformer.layers.1.attention.rotary_emb.inv_freq', 'transformer.layers.5.attention.rotary_emb.inv_freq', 'transformer.layers.12.attention.rotary_emb.inv_freq', 'transformer.layers.24.attention.rotary_emb.inv_freq', 'transformer.layers.20.attention.rotary_emb.inv_freq', 'transformer.layers.18.attention.rotary_emb.inv_freq', 'transformer.layers.0.attention.rotary_emb.inv_freq', 'transformer.layers.6.attention.rotary_emb.inv_freq', 'transformer.layers.22.attention.rotary_emb.inv_freq', 'transformer.layers.14.attention.rotary_emb.inv_freq', 'transformer.layers.9.attention.rotary_emb.inv_freq', 'transformer.layers.7.attention.rotary_emb.inv_freq']

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Development\AI_Projects\Paddle-ChatDocuments\chat_documents.py", line 276, in chatglm_documents.chatglm_bot('chatglm-6b的局限性在哪里?如何改进?', File "D:\Development\AI_Projects\Paddle-ChatDocuments\chat_documents.py", line 256, in chatglm_bot prediction = pipe.run(query=query, File "C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\pipelines\pipelines\base.py", line 449, in run raise Exception( Exception: Exception while running node ChatGLMBot with input {'query': '基于以下已知信息,请简洁并专业地回答用户的问题。\n 如果无法从中得到答案,请说 "根据已知信息无法回答该问题" 或 "没有提供足够的相关信息"。不允许在答案 中添加编造成分。另外,答案请使用中文。\n\n 已知内容: \n \n 问题:chatglm-6b的局限性在哪里?如何改进?', 'history': [], 'documents': [], 'root_node': 'Query', 'params': {'Retriever': {'top_k': 10}, 'TruncateHistory': {'history': []}}, 'node_id': 'ChatGLMBot'}: (NotFound) The kernel with key (GPU, NCHW, float16) of kernel multinomial is not registered and fail to fallback to CPU one. [Hint: Expected kernel_iter != iter->second.end(), but received kernel_iter == iter->second.end().] (at ..\paddle\phi\core\kernel_factory.cc:168) , full stack trace: Traceback (most recent call last): File "C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\pipelines\pipelines\base.py", line 446, in run node_output, stream_id = self.graph.nodes[node_id]["component"]._dispatch_run(node_input) File "C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\pipelines\nodes\base.py", line 120, in _dispatch_run return self._dispatch_run_general(self.run, kwargs) File "C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\pipelines\nodes\base.py", line 164, in _dispatch_run_general output, stream = run_method(run_inputs, run_params) File "C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\pipelines\nodes\llm\chatglm.py", line 60, in run result = self.predict(query=query, stream=stream) File "C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\pipelines\nodes\llm\chatglm.py", line 50, in predict result = self.chatglm(query) File "C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\paddlenlp-2.5.2.post0-py3.9.egg\paddlenlp\taskflow\taskflow.py", line 802, in call results = self.task_instance(inputs) File "C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\paddlenlp-2.5.2.post0-py3.9.egg\paddlenlp\taskflow\task.py", line 522, in call outputs = self._run_model(inputs) File "C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\paddlenlp-2.5.2.post0-py3.9.egg\paddlenlp\taskflow\text2text_generation.py", line 196, in _run_model result = self._model.generate( File "C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\decorator.py", line 232, in fun return caller(func, *(extras + args), *kw) File "C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\paddle\fluid\dygraph\base.py", line 375, in _decorate_function return func(args, **kwargs) File "C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\paddlenlp-2.5.2.post0-py3.9.egg\paddlenlp\transformers\generation_utils.py", line 947, in generate return self.sample( File "C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\paddlenlp-2.5.2.post0-py3.9.egg\paddlenlp\transformers\generation_utils.py", line 1136, in sample next_tokens = paddle.multinomial(probs) File "C:\Users\rober\miniconda3\envs\paddle\lib\site-packages\paddle\tensor\random.py", line 186, in multinomial return _C_ops.multinomial(x, num_samples, replacement) RuntimeError: (NotFound) The kernel with key (GPU, NCHW, float16) of kernel multinomial is not registered and fail to fallback to CPU one. [Hint: Expected kernel_iter != iter->second.end(), but received kernel_iter == iter->second.end().] (at ..\paddle\phi\core\kernel_factory.cc:168)

robertoding commented 1 year ago

在ubuntu22.04上也是一样的问题。