diff --git a/README.md b/README.md index 484dc99..cede55f 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,12 @@ pip install -r requirements.txt ``` Please use the latest version of `vllm`, as the older version may not enable you to set `skip_special_tokens` via `SamplingParam`, which is added by ([this PR](https://github.com/vllm-project/vllm/issues/893)). +You can also create a conda environment by running the command below. + +``` +conda env create -f environment.yml +``` + ## Quick start You can download Self-RAG from HuggingFace Hub. For inference, we recommend using [vllm](https://vllm.readthedocs.io/en/latest/) as it significantly speeds up inferences. diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..ea2900d --- /dev/null +++ b/environment.yml @@ -0,0 +1,167 @@ +name: selfrag +channels: + - nvidia/label/cuda-12.1.0 + - defaults +dependencies: + - _libgcc_mutex=0.1=main + - _openmp_mutex=5.1=1_gnu + - ca-certificates=2023.12.12=h06a4308_0 + - cuda-nvcc=12.1.66=0 + - ld_impl_linux-64=2.38=h1181459_1 + - libffi=3.4.4=h6a678d5_0 + - libgcc-ng=11.2.0=h1234567_1 + - libgomp=11.2.0=h1234567_1 + - libstdcxx-ng=11.2.0=h1234567_1 + - ncurses=6.4=h6a678d5_0 + - openssl=3.0.12=h7f8727e_0 + - pip=23.3.1=py38h06a4308_0 + - python=3.8.18=h955ad1f_0 + - readline=8.2=h5eee18b_0 + - setuptools=68.2.2=py38h06a4308_0 + - sqlite=3.41.2=h5eee18b_0 + - tk=8.6.12=h1ccaba5_0 + - wheel=0.41.2=py38h06a4308_0 + - xz=5.4.5=h5eee18b_0 + - zlib=1.2.13=h5eee18b_0 + - pip: + - absl-py==2.0.0 + - accelerate==0.25.0 + - aiohttp==3.9.1 + - aioprometheus==23.3.0 + - aiosignal==1.3.1 + - anyio==3.7.1 + - async-timeout==4.0.3 + - attrs==23.1.0 + - bitsandbytes==0.41.3.post2 + - blis==0.7.11 + - cachetools==5.3.2 + - catalogue==2.0.10 + - certifi==2023.11.17 + - charset-normalizer==3.3.2 + - click==8.1.7 + - cloudpathlib==0.16.0 + - colorama==0.4.6 + - confection==0.1.4 + - cymem==2.0.8 + - dataclasses==0.6 + - datasets==2.15.0 + - deepspeed==0.12.6 + - dill==0.3.7 + - einops==0.7.0 + - evaluate==0.4.1 + - exceptiongroup==1.2.0 + - fastapi==0.105.0 + - filelock==3.13.1 + - flash-attn==2.3.6 + - frozenlist==1.4.1 + - fsspec==2023.10.0 + - google-auth==2.25.2 + - google-auth-oauthlib==1.0.0 + - grpcio==1.60.0 + - h11==0.14.0 + - hjson==3.1.0 + - httptools==0.6.1 + - huggingface-hub==0.20.1 + - idna==3.6 + - importlib-metadata==7.0.0 + - importlib-resources==6.1.1 + - jinja2==3.1.2 + - joblib==1.3.2 + - jsonlines==4.0.0 + - jsonschema==4.20.0 + - jsonschema-specifications==2023.11.2 + - langcodes==3.3.0 + - lxml==4.9.4 + - markdown==3.5.1 + - markupsafe==2.1.3 + - mpmath==1.3.0 + - msgpack==1.0.7 + - multidict==6.0.4 + - multiprocess==0.70.15 + - murmurhash==1.0.10 + - networkx==3.1 + - ninja==1.11.1.1 + - nltk==3.8.1 + - numpy==1.24.4 + - nvidia-cublas-cu12==12.1.3.1 + - nvidia-cuda-cupti-cu12==12.1.105 + - nvidia-cuda-nvrtc-cu12==12.1.105 + - nvidia-cuda-runtime-cu12==12.1.105 + - nvidia-cudnn-cu12==8.9.2.26 + - nvidia-cufft-cu12==11.0.2.54 + - nvidia-curand-cu12==10.3.2.106 + - nvidia-cusolver-cu12==11.4.5.107 + - nvidia-cusparse-cu12==12.1.0.106 + - nvidia-nccl-cu12==2.18.1 + - nvidia-nvjitlink-cu12==12.3.101 + - nvidia-nvtx-cu12==12.1.105 + - oauthlib==3.2.2 + - openai==0.28.1 + - orjson==3.9.10 + - packaging==23.2 + - pandas==2.0.3 + - peft==0.7.1 + - pkgutil-resolve-name==1.3.10 + - portalocker==2.8.2 + - preshed==3.0.9 + - protobuf==4.25.1 + - psutil==5.9.7 + - py-cpuinfo==9.0.0 + - pyarrow==14.0.2 + - pyarrow-hotfix==0.6 + - pyasn1==0.5.1 + - pyasn1-modules==0.3.0 + - pydantic==1.10.13 + - pynvml==11.5.0 + - python-dateutil==2.8.2 + - python-dotenv==1.0.0 + - pytz==2023.3.post1 + - pyyaml==6.0.1 + - quantile-python==1.1 + - ray==2.9.0 + - referencing==0.32.0 + - regex==2023.10.3 + - requests==2.31.0 + - requests-oauthlib==1.3.1 + - responses==0.18.0 + - rouge-score==0.1.2 + - rpds-py==0.15.2 + - rsa==4.9 + - sacrebleu==2.4.0 + - safetensors==0.4.1 + - sentencepiece==0.1.99 + - six==1.16.0 + - smart-open==6.4.0 + - sniffio==1.3.0 + - spacy==3.7.2 + - spacy-legacy==3.0.12 + - spacy-loggers==1.0.5 + - srsly==2.4.8 + - starlette==0.27.0 + - sympy==1.12 + - tabulate==0.9.0 + - tensorboard==2.14.0 + - tensorboard-data-server==0.7.2 + - thinc==8.2.2 + - tiktoken==0.5.2 + - tokenizers==0.15.0 + - torch==2.1.2 + - tqdm==4.66.1 + - transformers==4.36.2 + - triton==2.1.0 + - typer==0.9.0 + - typing-extensions==4.9.0 + - tzdata==2023.3 + - urllib3==2.1.0 + - uvicorn==0.25.0 + - uvloop==0.19.0 + - vllm==0.2.6 + - wasabi==1.1.2 + - watchfiles==0.21.0 + - weasel==0.3.4 + - websockets==12.0 + - werkzeug==3.0.1 + - xformers==0.0.23.post1 + - xxhash==3.4.1 + - yarl==1.9.4 + - zipp==3.17.0 diff --git a/requirements.txt b/requirements.txt index 9e26742..bb58013 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,27 +1,33 @@ +# Recommend to use conda environment. +# Please first check nvcc version and +# make sure it satisfies the vLLM's +# requirements. +vllm==0.2.6 tqdm -vllm spacy +scikit-learn jsonlines -torch -transformers +transformers==4.36.2 filelock -datasets +datasets==2.15.0 nltk dataclasses -sacrebleu -rouge_score -peft -bitsandbytes -flash-attn==2.2.2 -einops +sacrebleu==2.4.0 +rouge_score==0.1.2 +flash-attn==2.3.6 +einops==0.7.0 sentencepiece -deepspeed>=0.10.0 -accelerate>=0.21.0,<0.23.0 # 0.23.0 will cause an incorrect learning rate schedule when using deepspeed, which is likely caused by https://github.com/huggingface/accelerate/commit/727d624322c67db66a43c559d8c86414d5ffb537 -peft>=0.4.0 +deepspeed==0.12.6 +accelerate==0.25.0 +peft==0.7.1 bitsandbytes>=0.41.1 -evaluate>=0.4.0 -tokenizers>=0.13.3 -tensorboard +evaluate==0.4.1 +tokenizers==0.15.0 +tensorboard==2.14.0 openai==0.28.1 -tiktoken -factscore==0.1.5 +tiktoken==0.5.2 + +# Please install factscore in a separate +# env. There are conflicts with other +# packages. +# factscore==0.1.5