ymcui / Chinese-LLaMA-Alpaca

中文LLaMA&Alpaca大语言模型+本地CPU/GPU训练部署 (Chinese LLaMA & Alpaca LLMs)
https://github.com/ymcui/Chinese-LLaMA-Alpaca/wiki
Apache License 2.0
18.23k stars 1.86k forks source link

langchain示例未正確輸出 #712

Closed cyc00518 closed 1 year ago

cyc00518 commented 1 year ago

提交前必须检查以下项目

问题类型

效果问题

基础模型

Alpaca-Plus-7B

操作系统

Linux

详细描述问题

您好, 運行庫裡的 langchain_sum.py 僅輸出了一個'已'字 可能是什麼問題呢?

謝謝!

python langchain_sum.py --file_path=doc.txt --model_path=./chinese-alpaca-plus-7b-merged-hf

loading LLM...
The model weights are not tied. Please use the `tie_weights` method before using the `infer_auto_device` function.
Loading checkpoint shards: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:13<00:00,  6.76s/it]
Device has 1 GPUs available. Provide device={deviceId} to `from_model_id` to use availableGPUs for execution. deviceId is -1 (default) for CPU and can be a positive integer associated with CUDA device id.
/home/appuser/.local/lib/python3.8/site-packages/transformers/generation/utils.py:1259: UserWarning: You have modified the pretrained model configuration to control generation. This is a deprecated strategy to control generation and will be removed soon, in a future version. Please use a generation configuration file (see https://huggingface.co/docs/transformers/main_classes/text_generation)
  warnings.warn(
/home/appuser/.local/lib/python3.8/site-packages/transformers/generation/utils.py:1353: UserWarning: Using `max_length`'s default (1000) to control the generation length. This behaviour is deprecated and will be removed from the config in v5 of Transformers -- we recommend using `max_new_tokens` to control the maximum length of the generation.
  warnings.warn(
/home/appuser/.local/lib/python3.8/site-packages/transformers/generation/utils.py:1452: UserWarning: You are calling .generate() with the `input_ids` being on a device type different than your model's device. `input_ids` is on cpu, whereas the model is on cuda. You may experience unexpected behaviors or slower generation. Please make sure that you have put `input_ids` to the correct device by calling for example input_ids = input_ids.to('cuda') before running `.generate()`.
  warnings.warn(
Input length of input_ids is 1038, but `max_length` is set to 1000. This can lead to unexpected behavior. You should consider increasing `max_new_tokens`.
已

依赖情况(代码类问题务必提供)

Package                       Version
----------------------------- ------------------------
absl-py                       1.2.0
accelerate                    0.20.3
aiohttp                       3.8.4
aiosignal                     1.3.1
alabaster                     0.7.12
apex                          0.1
appdirs                       1.4.4
argon2-cffi                   21.3.0
argon2-cffi-bindings          21.2.0
asttokens                     2.0.5
async-timeout                 4.0.2
attrs                         22.1.0
audioread                     2.1.9
Babel                         2.10.3
backcall                      0.2.0
backports.functools-lru-cache 1.6.4
beautifulsoup4                4.11.1
bitsandbytes                  0.37.2
bleach                        5.0.1
blis                          0.7.8
brotlipy                      0.7.0
cachetools                    5.2.0
catalogue                     2.0.6
certifi                       2022.6.15
cffi                          1.15.1
chardet                       5.0.0
charset-normalizer            2.1.0
click                         8.0.4
cloudpickle                   2.1.0
cmake                         3.26.4
codecov                       2.1.12
colorama                      0.4.5
conda                         4.13.0
conda-build                   3.21.9
conda-package-handling        1.8.1
coverage                      6.4.2
cryptography                  37.0.4
cuda-python                   11.6.0
cudf                          22.6.0a0+319.g97422602b8
cugraph                       22.6.0a0+114.gc6bc8867
cuml                          22.6.0a0+71.g59a124168
cupy-cuda115                  10.5.0
cycler                        0.11.0
cymem                         2.0.6
Cython                        0.29.32
dask                          2022.5.2
dask-cuda                     22.6.0
dask-cudf                     22.6.0a0+319.g97422602b8
dataclasses                   0.8
dataclasses-json              0.5.9
datasets                      2.8.0
debugpy                       1.6.2
decorator                     5.1.1
deepspeed                     0.8.3
defusedxml                    0.7.1
dill                          0.3.6
distributed                   2022.5.2
docutils                      0.17.1
entrypoints                   0.3
executing                     0.9.1
expecttest                    0.1.3
fastjsonschema                2.16.1
fastrlock                     0.8
filelock                      3.7.1
flake8                        3.7.9
Flask                         2.2.1
fonttools                     4.34.4
frozenlist                    1.3.3
fsspec                        2022.7.1
future                        0.18.2
glob2                         0.7
google-auth                   2.9.1
google-auth-oauthlib          0.4.6
graphsurgeon                  0.4.6
greenlet                      2.0.2
grpcio                        1.47.0
HeapDict                      1.0.1
hjson                         3.1.0
huggingface-hub               0.15.1
hypothesis                    4.50.8
idna                          3.3
imagesize                     1.4.1
importlib-metadata            4.12.0
importlib-resources           5.9.0
iniconfig                     1.1.1
iopath                        0.1.10
ipykernel                     6.15.1
ipython                       8.4.0
ipython-genutils              0.2.0
itsdangerous                  2.1.2
jedi                          0.18.1
Jinja2                        3.1.2
joblib                        1.1.0
json5                         0.9.9
jsonschema                    4.9.1
jupyter-client                7.3.4
jupyter-core                  4.11.1
jupyter-tensorboard           0.2.0
jupyterlab                    2.3.2
jupyterlab-pygments           0.2.2
jupyterlab-server             1.2.0
jupytext                      1.14.1
kiwisolver                    1.4.4
langchain                     0.0.221
langchainplus-sdk             0.0.19
langcodes                     3.3.0
libarchive-c                  4.0
librosa                       0.9.2
lit                           16.0.6
llvmlite                      0.36.0
lmdb                          1.3.0
locket                        1.0.0
Markdown                      3.4.1
markdown-it-py                2.1.0
MarkupSafe                    2.1.1
marshmallow                   3.19.0
marshmallow-enum              1.5.1
matplotlib                    3.3.4
matplotlib-inline             0.1.3
mccabe                        0.6.1
mdit-py-plugins               0.3.0
mdurl                         0.1.1
mistune                       0.8.4
mock                          4.0.3
mpmath                        1.3.0
msgpack                       1.0.4
multidict                     6.0.4
multiprocess                  0.70.14
murmurhash                    1.0.7
mypy-extensions               1.0.0
nbclient                      0.6.6
nbconvert                     6.5.0
nbformat                      5.4.0
nest-asyncio                  1.5.5
networkx                      2.6.3
ninja                         1.11.1
nltk                          3.7
notebook                      6.4.10
numba                         0.56.0
numexpr                       2.8.4
numpy                         1.22.4
nvidia-cublas-cu11            11.10.3.66
nvidia-cuda-cupti-cu11        11.7.101
nvidia-cuda-nvrtc-cu11        11.7.99
nvidia-cuda-runtime-cu11      11.7.99
nvidia-cudnn-cu11             8.5.0.96
nvidia-cufft-cu11             10.9.0.58
nvidia-curand-cu11            10.2.10.91
nvidia-cusolver-cu11          11.4.0.1
nvidia-cusparse-cu11          11.7.4.91
nvidia-dali-cuda110           1.16.0
nvidia-nccl-cu11              2.14.3
nvidia-nvtx-cu11              11.7.91
nvidia-pyindex                1.0.9
nvtx                          0.2.5
oauthlib                      3.2.0
onnx                          1.12.0
openapi-schema-pydantic       1.2.4
packaging                     21.3
pandas                        1.1.5
pandocfilters                 1.5.0
parso                         0.8.3
partd                         1.2.0
pathy                         0.6.2
peft                          0.3.0.dev0
pexpect                       4.8.0
pickleshare                   0.7.5
Pillow                        9.0.1
pip                           23.1
pkginfo                       1.8.3
pkgutil_resolve_name          1.3.10
pluggy                        1.0.0
polygraphy                    0.33.0
pooch                         1.6.0
portalocker                   2.5.1
preshed                       3.0.6
prettytable                   3.3.0
prometheus-client             0.14.1
prompt-toolkit                3.0.30
protobuf                      3.20.1
psutil                        5.9.1
ptyprocess                    0.7.0
pure-eval                     0.2.2
py                            1.11.0
py-cpuinfo                    9.0.0
pyarrow                       7.0.0
pyasn1                        0.4.8
pyasn1-modules                0.2.8
pybind11                      2.10.0
pycocotools                   2.0+nv0.6.0
pycodestyle                   2.5.0
pycosat                       0.6.3
pycparser                     2.21
pydantic                      1.10.8
pydot                         1.4.2
pyflakes                      2.1.1
Pygments                      2.12.0
pylibcugraph                  22.6.0a0+114.gc6bc8867
pymongo                       3.11.3
pynvml                        11.4.1
pyOpenSSL                     22.0.0
pyparsing                     3.0.9
pyre-extensions               0.0.29
pyrsistent                    0.18.1
PySocks                       1.7.1
pytest                        6.2.5
pytest-cov                    3.0.0
pytest-pythonpath             0.7.4
python-dateutil               2.8.2
python-hostlist               1.21
python-nvd3                   0.15.0
python-slugify                6.1.2
pytorch-quantization          2.1.2
pytz                          2022.1
PyYAML                        6.0
pyzmq                         23.2.0
raft                          22.6.0a0+85.g3e5a625
regex                         2022.7.25
requests                      2.28.1
requests-oauthlib             1.3.1
resampy                       0.3.1
responses                     0.18.0
revtok                        0.0.3
rmm                           22.6.0a0+76.g185c18e6
rsa                           4.9
ruamel-yaml-conda             0.15.80
sacremoses                    0.0.53
safetensors                   0.3.1
scikit-learn                  0.24.2
scipy                         1.6.3
Send2Trash                    1.8.0
sentencepiece                 0.1.97
setuptools                    59.5.0
shellingham                   1.4.0
six                           1.16.0
smart-open                    5.2.1
snowballstemmer               2.2.0
sortedcontainers              2.4.0
SoundFile                     0.10.3.post1
soupsieve                     2.3.2.post1
spacy                         3.4.1
spacy-legacy                  3.0.9
spacy-loggers                 1.0.2
Sphinx                        5.1.1
sphinx-glpi-theme             0.3
sphinx-rtd-theme              1.0.0
sphinxcontrib-applehelp       1.0.2
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.5
SQLAlchemy                    2.0.17
srsly                         2.4.4
stack-data                    0.3.0
sympy                         1.12
tabulate                      0.8.10
tblib                         1.7.0
tenacity                      8.2.2
tensorboard                   2.9.1
tensorboard-data-server       0.6.1
tensorboard-plugin-wit        1.8.1
tensorrt                      8.4.2.4
terminado                     0.15.0
text-unidecode                1.3
thinc                         8.1.0
threadpoolctl                 3.1.0
tinycss2                      1.1.1
tokenizers                    0.13.3
toml                          0.10.2
tomli                         2.0.1
toolz                         0.12.0
torch                         2.0.1
torch-tensorrt                1.2.0a0
torchtext                     0.11.0a0
torchvision                   0.14.0a0
tornado                       6.2
tqdm                          4.64.0
traitlets                     5.3.0
transformers                  4.30.0
treelite                      2.4.0
treelite-runtime              2.4.0
triton                        2.0.0
typer                         0.4.2
typing_extensions             4.3.0
typing-inspect                0.9.0
ucx-py                        0.26.0a0+19.g1b942b8
uff                           0.6.9
urllib3                       1.26.11
wasabi                        0.10.0
wcwidth                       0.2.5
webencodings                  0.5.1
Werkzeug                      2.2.1
wheel                         0.37.1
xformers                      0.0.20
xgboost                       1.6.1
xxhash                        3.2.0
yarl                          1.9.2
zict                          2.2.0
zipp                          3.8.1

运行日志或截图

# 请在此处粘贴运行日志
airaria commented 1 year ago

看日志提示:

Input length of input_ids is 1038, but `max_length` is set to 1000. This can lead to unexpected behavior. You should consider increasing `max_new_tokens`.

因为输入太长了,要调整最大输入长度或max_new_tokens

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your consideration.