PaddlePaddle / PaddleNLP

👑 Easy-to-use and powerful NLP and LLM library with 🤗 Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including 🗂Text Classification, 🔍 Neural Search, ❓ Question Answering, ℹ️ Information Extraction, 📄 Document Intelligence, 💌 Sentiment Analysis etc.
https://paddlenlp.readthedocs.io
Apache License 2.0
12.11k stars 2.94k forks source link

[Question]: python rest_api/application.py 不能访问API Documentation接口 #8155

Closed justforyou2017 closed 7 months ago

justforyou2017 commented 7 months ago

请提出你的问题

没有打印这些logger.info("Open http://127.0.0.1:8000/docs to see Swagger API Documentation.") 不能访问http://127.0.0.1:8000/docs接口?

D:\application\miniconda3\envs\py11\Lib\site-packages_distutils_hack__init__.py:26: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.")

============================== False WARNING - pipelines.pipelines.base - YAML version (1.1.0) does not match with pipelines version (0.0.0). Issues may occur during loading. To fix this warning, save again this pipeline with the current pipelines version using Pipeline.save_to_yaml(), or downgrade to pipelines version 0.0.0. INFO - elasticsearch - HEAD http://localhost:9200/ [status:200 request:0.005s] INFO - elasticsearch - HEAD http://localhost:9200/dureader_robust_base_encoder [status:200 request:0.000s] INFO - elasticsearch - GET http://localhost:9200/dureader_robust_base_encoder [status:200 request:0.002s] INFO - elasticsearch - PUT http://localhost:9200/dureader_robust_base_encoder/_mapping [status:200 request:0.009s] INFO - elasticsearch - HEAD http://localhost:9200/label [status:200 request:0.001s] INFO - pipelines.utils.common_utils - Using devices: PLACE(CPU) INFO - pipelines.utils.common_utils - Number of GPUs: 0 [2024-03-20 14:31:19,446] [ INFO] - We are using (<class 'paddlenlp.transformers.ernie.tokenizer.ErnieTokenizer'>, False) to load 'rocketqa-zh-base-query-encoder'. [2024-03-20 14:31:19,463] [ INFO] - tokenizer config file saved in C:\Users\Administrator.paddlenlp\models\rocketqa-zh-base-query-encoder\tokenizer_config.json [2024-03-20 14:31:19,464] [ INFO] - Special tokens file saved in C:\Users\Administrator.paddlenlp\models\rocketqa-zh-base-query-encoder\special_tokens_map.json E0320 14:31:19.464350 5620 analysis_config.cc:653] Please compile with MKLDNN first to use MKLDNN [2024-03-20 14:31:20,103] [ INFO] - We are using (<class 'paddlenlp.transformers.ernie.tokenizer.ErnieTokenizer'>, False) to load 'rocketqa-zh-base-para-encoder'. [2024-03-20 14:31:20,118] [ INFO] - tokenizer config file saved in C:\Users\Administrator.paddlenlp\models\rocketqa-zh-base-para-encoder\tokenizer_config.json [2024-03-20 14:31:20,118] [ INFO] - Special tokens file saved in C:\Users\Administrator.paddlenlp\models\rocketqa-zh-base-para-encoder\special_tokens_map.json E0320 14:31:20.120841 5620 analysis_config.cc:653] Please compile with MKLDNN first to use MKLDNN WARNING - pipelines.pipelines.base - YAML version (1.1.0) does not match with pipelines version (0.0.0). Issues may occur during loading. To fix this warning, save again this pipeline with the current pipelines version using Pipeline.save_to_yaml(), or downgrade to pipelines version 0.0.0. WARNING - rest_api.controller.file_upload - Request pipeline ('indexing_qa_generating: is null'). D:\application\miniconda3\envs\py11\Lib\site-packages\pydantic_internal_fields.py:186: UserWarning: Field name "answer" shadows an attribute in parent "Label"; warnings.warn( D:\application\miniconda3\envs\py11\Lib\site-packages\pydantic_internal_fields.py:186: UserWarning: Field name "no_answer" shadows an attribute in parent "Label"; warnings.warn( D:\application\miniconda3\envs\py11\Lib\site-packages\pydantic_internal_fields.py:186: UserWarning: Field name "pipeline_id" shadows an attribute in parent "Label"; warnings.warn( D:\application\miniconda3\envs\py11\Lib\site-packages\pydantic_internal_fields.py:186: UserWarning: Field name "created_at" shadows an attribute in parent "Label"; warnings.warn( D:\application\miniconda3\envs\py11\Lib\site-packages\pydantic_internal_fields.py:186: UserWarning: Field name "updated_at" shadows an attribute in parent "Label"; warnings.warn( D:\application\miniconda3\envs\py11\Lib\site-packages\pydantic_internal_fields.py:186: UserWarning: Field name "meta" shadows an attribute in parent "Label"; warnings.warn( D:\application\miniconda3\envs\py11\Lib\site-packages\pydantic_internal_fields.py:186: UserWarning: Field name "filters" shadows an attribute in parent "Label"; warnings.warn( WARNING - pipelines.pipelines.base - YAML version (1.1.0) does not match with pipelines version (0.0.0). Issues may occur during loading. To fix this warning, save again this pipeline with the current pipelines version using Pipeline.save_to_yaml(), or downgrade to pipelines version 0.0.0. INFO - elasticsearch - HEAD http://localhost:9200/ [status:200 request:0.003s] INFO - elasticsearch - HEAD http://localhost:9200/dureader_robust_base_encoder [status:200 request:0.001s] INFO - elasticsearch - GET http://localhost:9200/dureader_robust_base_encoder [status:200 request:0.001s] INFO - elasticsearch - PUT http://localhost:9200/dureader_robust_base_encoder/_mapping [status:200 request:0.007s] INFO - elasticsearch - HEAD http://localhost:9200/label [status:200 request:0.001s] INFO - pipelines.utils.common_utils - Using devices: PLACE(CPU) INFO - pipelines.utils.common_utils - Number of GPUs: 0 [2024-03-20 14:31:20,883] [ INFO] - We are using (<class 'paddlenlp.transformers.ernie.tokenizer.ErnieTokenizer'>, False) to load 'rocketqa-zh-base-query-encoder'. [2024-03-20 14:31:20,897] [ INFO] - tokenizer config file saved in C:\Users\Administrator.paddlenlp\models\rocketqa-zh-base-query-encoder\tokenizer_config.json [2024-03-20 14:31:20,898] [ INFO] - Special tokens file saved in C:\Users\Administrator.paddlenlp\models\rocketqa-zh-base-query-encoder\special_tokens_map.json E0320 14:31:20.898706 5620 analysis_config.cc:653] Please compile with MKLDNN first to use MKLDNN [2024-03-20 14:31:21,492] [ INFO] - We are using (<class 'paddlenlp.transformers.ernie.tokenizer.ErnieTokenizer'>, False) to load 'rocketqa-zh-base-para-encoder'. [2024-03-20 14:31:21,510] [ INFO] - tokenizer config file saved in C:\Users\Administrator.paddlenlp\models\rocketqa-zh-base-para-encoder\tokenizer_config.json [2024-03-20 14:31:21,511] [ INFO] - Special tokens file saved in C:\Users\Administrator.paddlenlp\models\rocketqa-zh-base-para-encoder\special_tokens_map.json E0320 14:31:21.512238 5620 analysis_config.cc:653] Please compile with MKLDNN first to use MKLDNN INFO - pipelines.utils.common_utils - Using devices: PLACE(CPU) INFO - pipelines.utils.common_utils - Number of GPUs: 0 INFO - pipelines.nodes.ranker.ernie_ranker - Loading Parameters from:rocketqa-base-cross-encoder E0320 14:31:23.402297 5620 analysis_config.cc:653] Please compile with MKLDNN first to use MKLDNN [2024-03-20 14:31:24,570] [ INFO] - tokenizer config file saved in C:\Users\Administrator.paddlenlp\models\rocketqa-base-cross-encoder\tokenizer_config.json [2024-03-20 14:31:24,573] [ INFO] - Special tokens file saved in C:\Users\Administrator.paddlenlp\models\rocketqa-base-cross-encoder\special_tokens_map.json WARNING - pipelines.pipelines.base - YAML version (1.1.0) does not match with pipelines version (0.0.0). Issues may occur during loading. To fix this warning, save again this pipeline with the current pipelines version using Pipeline.save_to_yaml(), or downgrade to pipelines version 0.0.0. WARNING - pipelines - Request pipeline ('query_qa_pairs: is null'). INFO: Started server process [17360] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8891 (Press CTRL+C to quit)

w5688414 commented 7 months ago

没理解,如果是本机的话,是不能打开下面的链接吗?

http://localhost:8891/docs
justforyou2017 commented 7 months ago

application = FastAPI(title="pipelines REST API", debug=True, version=pipelines_version, root_path=ROOT_PATH) 坑货多加了一个root_path后URL就不对了,对与刚刚了解fastAPI的人太不友好了