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
11.71k stars 2.86k forks source link

Fix different length for numpy>=1.24.x #8655

Closed DrownFish19 closed 3 days ago

DrownFish19 commented 4 days ago

PR types

Bug fixes

PR changes

Others

Description

Fix different length for numpy>=1.24.x

numpy version >= 1.24.x, the following code is not work

import numpy as np
arr = np.asarray([[1], [1,2]])

numpy version =1.23.x gives the warning as follows:

<stdin>:1: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
paddle-bot[bot] commented 4 days ago

Thanks for your contribution!

codecov[bot] commented 4 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 55.80%. Comparing base (65e721e) to head (07673ea). Report is 4 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #8655 +/- ## ======================================== Coverage 55.80% 55.80% ======================================== Files 620 620 Lines 96642 96642 ======================================== Hits 53928 53928 Misses 42714 42714 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.