Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/conda/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$PYTHON setup.py install # Python command to install the script.
48 changes: 48 additions & 0 deletions .github/conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{% set name = "transformers" %}

package:
name: "{{ name|lower }}"
version: "{{ TRANSFORMERS_VERSION }}"

source:
path: ../../

build:
noarch: python

requirements:
host:
- python
- pip
- numpy
- dataclasses
- packaging
- filelock
- requests
- tqdm >=4.27
- sacremoses
- regex !=2019.12.17
- protobuf
- tokenizers ==0.9.4
run:
- python
- numpy
- dataclasses
- packaging
- filelock
- requests
- tqdm >=4.27
- sacremoses
- regex !=2019.12.17
- protobuf
- tokenizers ==0.9.4

test:
imports:
- transformers

about:
home: https://huggingface.co
license: Apache License 2.0
license_file: LICENSE
summary: "🤗Transformers: State-of-the-art Natural Language Processing for Pytorch and TensorFlow 2.0."
43 changes: 43 additions & 0 deletions .github/workflows/release-conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release - Conda

on:
push:
tags:
- v*

env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}

jobs:
build_and_package:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout repository
uses: actions/checkout@v1

- name: Install miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
auto-activate-base: false
activate-environment: "build-transformers"
channels: huggingface

- name: Setup conda env
run: |
conda install -c defaults anaconda-client conda-build

- name: Extract version
run: echo "TRANSFORMERS_VERSION=`python setup.py --version`" >> $GITHUB_ENV

- name: Build conda packages
run: |
conda info
conda build .github/conda

- name: Upload to Anaconda
run: anaconda upload `conda build .github/conda --output` --force
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,15 @@ The model itself is a regular [Pytorch `nn.Module`](https://pytorch.org/docs/sta

## Installation

### With pip

This repository is tested on Python 3.6+, PyTorch 1.0.0+ (PyTorch 1.3.1+ for [examples](https://github.com/huggingface/transformers/tree/master/examples)) and TensorFlow 2.0.

You should install 🤗 Transformers in a [virtual environment](https://docs.python.org/3/library/venv.html). If you're unfamiliar with Python virtual environments, check out the [user guide](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/).

First, create a virtual environment with the version of Python you're going to use and activate it.

Then, you will need to install one of, or both, TensorFlow 2.0 and PyTorch.
Then, you will need to install at least one of TensorFlow 2.0, PyTorch or Flax.
Comment thread
LysandreJik marked this conversation as resolved.
Please refer to [TensorFlow installation page](https://www.tensorflow.org/install/pip#tensorflow-2.0-rc-is-available) and/or [PyTorch installation page](https://pytorch.org/get-started/locally/#start-locally) regarding the specific install command for your platform.

When TensorFlow 2.0 and/or PyTorch has been installed, 🤗 Transformers can be installed using pip as follows:
Expand All @@ -154,6 +156,18 @@ pip install transformers

If you'd like to play with the examples, you must [install the library from source](https://huggingface.co/transformers/installation.html#installing-from-source).

### With conda

Since Transformers version v4.0.0, we now have a conda channel: `huggingface`.

🤗 Transformers can be installed using conda as follows:

```shell script
conda install -c huggingface transformers
```

TensorFlow, PyTorch or Flax should be installed from their respective conda channels.
Comment thread
LysandreJik marked this conversation as resolved.
Outdated

## Models architectures

**[All the model checkpoints](https://huggingface.co/models)** provided by 🤗 Transformers are seamlessly integrated from the huggingface.co [model hub](https://huggingface.co) where they are uploaded directly by [users](https://huggingface.co/users) and [organizations](https://huggingface.co/organizations).
Expand Down
13 changes: 13 additions & 0 deletions docs/source/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,19 @@ python -c "from transformers import pipeline; print(pipeline('sentiment-analysis

to check 🤗 Transformers is properly installed.


## With conda

Since Transformers version v4.0.0, we now have a conda channel: `huggingface`.

🤗 Transformers can be installed using conda as follows:

```shell script
conda install -c huggingface transformers
```

TensorFlow, PyTorch or Flax should be installed from their respective conda channels.
Comment thread
LysandreJik marked this conversation as resolved.
Outdated

## Caching models

This library provides pretrained models that will be downloaded and cached locally. Unless you specify a location with
Expand Down