mirror of
https://github.com/mii443/tokenizers.git
synced 2025-08-22 16:25:30 +00:00
Updating the docs with the new command. (#1333)
This commit is contained in:
@ -64,8 +64,7 @@ python -m venv .env
|
|||||||
source .env/bin/activate
|
source .env/bin/activate
|
||||||
|
|
||||||
# Install `tokenizers` in the current virtual env
|
# Install `tokenizers` in the current virtual env
|
||||||
pip install setuptools_rust
|
pip install -e .
|
||||||
python setup.py install
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Load a pretrained tokenizer from the Hub
|
### Load a pretrained tokenizer from the Hub
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
if ! command -v cargo &> /dev/null
|
|
||||||
then
|
|
||||||
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
|
||||||
fi
|
|
||||||
|
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
|
||||||
# https://users.rust-lang.org/t/cargo-uses-too-much-memory-being-run-in-qemu/76531
|
|
||||||
echo -e "[net]\ngit-fetch-with-cli = true" > "$HOME/.cargo/config"
|
|
||||||
|
|
||||||
for PYBIN in /opt/python/cp{37,38,39,310,311}*/bin; do
|
|
||||||
export PYTHON_SYS_EXECUTABLE="$PYBIN/python"
|
|
||||||
|
|
||||||
"${PYBIN}/pip" install -U setuptools-rust setuptools wheel
|
|
||||||
"${PYBIN}/python" setup.py bdist_wheel
|
|
||||||
rm -rf build/*
|
|
||||||
done
|
|
||||||
|
|
||||||
for whl in ./dist/*.whl; do
|
|
||||||
auditwheel repair "$whl" -w dist/
|
|
||||||
done
|
|
||||||
|
|
||||||
# Keep only manylinux wheels
|
|
||||||
rm ./dist/*-linux_*
|
|
||||||
|
|
||||||
|
|
||||||
# Upload wheels
|
|
||||||
/opt/python/cp37-cp37m/bin/pip install -U awscli
|
|
||||||
/opt/python/cp37-cp37m/bin/python -m awscli s3 sync --exact-timestamps ./dist "s3://tokenizers-releases/python/$DIST_DIR"
|
|
@ -1,9 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
for VARIABLE in "3.7.12" "3.8.12" "3.9.10" "3.10.2"
|
|
||||||
do
|
|
||||||
MACOSX_DEPLOYMENT_TARGET=10.11 SDKROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" CFLAGS="-I/usr/include/openssl -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include" CPPFLAGS="-I/usr/local/opt/zlib/include" LDFLAGS="-L/usr/lib -L/usr/local/opt/readline/lib" pyenv install $VARIABLE
|
|
||||||
|
|
||||||
~/.pyenv/versions/$VARIABLE/bin/pip install setuptools wheel setuptools-rust==0.11.3 --ignore-installed --force-reinstall
|
|
||||||
|
|
||||||
MACOSX_DEPLOYMENT_TARGET=10.11 ~/.pyenv/versions/$VARIABLE/bin/python setup.py bdist_wheel
|
|
||||||
done
|
|
@ -52,19 +52,12 @@ cd tokenizers/bindings/python
|
|||||||
```
|
```
|
||||||
|
|
||||||
At this point you should have your [virtual environment]() already
|
At this point you should have your [virtual environment]() already
|
||||||
activated. In order to compile 🤗 Tokenizers, you need to install the
|
activated. In order to compile 🤗 Tokenizers, you need to:
|
||||||
Python package `setuptools_rust`:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install setuptools_rust
|
pip install -e .
|
||||||
```
|
```
|
||||||
|
|
||||||
Then you can have 🤗 Tokenizers compiled and installed in your virtual
|
|
||||||
environment with the following command:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python setup.py install
|
|
||||||
```
|
|
||||||
</python>
|
</python>
|
||||||
<rust>
|
<rust>
|
||||||
## Crates.io
|
## Crates.io
|
||||||
@ -74,7 +67,7 @@ python setup.py install
|
|||||||
You just need to add it to your `Cargo.toml`:
|
You just need to add it to your `Cargo.toml`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
tokenizers = "0.10"
|
cargo add tokenizers
|
||||||
```
|
```
|
||||||
</rust>
|
</rust>
|
||||||
<node>
|
<node>
|
||||||
@ -86,4 +79,4 @@ You can simply install 🤗 Tokenizers with npm using:
|
|||||||
npm install tokenizers
|
npm install tokenizers
|
||||||
```
|
```
|
||||||
</node>
|
</node>
|
||||||
</tokenizerslangcontent>
|
</tokenizerslangcontent>
|
||||||
|
@ -37,11 +37,6 @@ Then we go into the python bindings folder::
|
|||||||
cd tokenizers/bindings/python
|
cd tokenizers/bindings/python
|
||||||
|
|
||||||
At this point you should have your `virtual environment`_ already activated. In order to
|
At this point you should have your `virtual environment`_ already activated. In order to
|
||||||
compile 🤗 Tokenizers, you need to install the Python package :obj:`setuptools_rust`::
|
compile 🤗 Tokenizers, you need to::
|
||||||
|
|
||||||
pip install setuptools_rust
|
pip install -e .
|
||||||
|
|
||||||
Then you can have 🤗 Tokenizers compiled and installed in your virtual environment with
|
|
||||||
the following command::
|
|
||||||
|
|
||||||
python setup.py install
|
|
||||||
|
Reference in New Issue
Block a user