Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Upgrade transformers to the latest version 4.34.1 #5994

Merged
merged 25 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e056325
Upgrade transformers to the latest version 4.34.0 so that Haystack ca…
grantmwilliams Oct 6, 2023
6d98b28
update release notes
grantmwilliams Oct 6, 2023
685c218
Merge branch 'main' into bump-transformers-to-4-34
grantmwilliams Oct 6, 2023
c3746ba
updated missing lazy import
grantmwilliams Oct 6, 2023
da4249f
Update .github workflows imports
grantmwilliams Oct 6, 2023
df2abfc
bump more versions in .github workflows
grantmwilliams Oct 6, 2023
eb28cc1
rever import sorting
grantmwilliams Oct 6, 2023
82f16ca
Update to catch runtime errors to match haystack_hub changes
grantmwilliams Oct 6, 2023
1d54ca2
Merge branch 'main' into bump-transformers-to-4-34
grantmwilliams Oct 6, 2023
e88ccfd
add language parameter value to whisper test
julian-risch Oct 8, 2023
e592478
Merge branch 'main' into bump-transformers-to-4-34
julian-risch Oct 11, 2023
e8f32dc
bump transformers version in linting preview workflow
julian-risch Oct 11, 2023
2f28516
bump transformers version in linting preview workflow
julian-risch Oct 11, 2023
a6e5485
Merge branch 'main' into bump-transformers-to-4-34
julian-risch Oct 16, 2023
5229fdd
bump version to v4.34.1
julian-risch Oct 19, 2023
3f4b3ce
Merge branch 'main' into bump-transformers-to-4-34
julian-risch Oct 19, 2023
db68156
resolve mypy issue with reused variables
julian-risch Oct 19, 2023
515a315
install openai-whisper without dependencies
julian-risch Oct 24, 2023
e778820
Merge branch 'main' into bump-transformers-to-4-34
julian-risch Oct 24, 2023
55619fe
remove audio extra, update whisper install instructions
julian-risch Oct 24, 2023
fb1f662
remove audio extra, update whisper install instructions
julian-risch Oct 24, 2023
97f8352
keep audio extra but add version
julian-risch Oct 24, 2023
3284178
keep audio extra with no constraints
julian-risch Oct 24, 2023
a15137a
remove audio extra
julian-risch Oct 24, 2023
2bab959
Merge branch 'main' into bump-transformers-to-4-34
julian-risch Oct 24, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/e2e_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
sudo apt install ffmpeg # for local Whisper tests

- name: Install Haystack
run: pip install .[dev,preview] langdetect transformers[torch,sentencepiece]==4.32.1 'sentence-transformers>=2.2.0' pypdf openai-whisper tika 'azure-ai-formrecognizer>=3.2.0b2'
run: pip install .[dev,preview] langdetect transformers[torch,sentencepiece]==4.34.0 'sentence-transformers>=2.2.0' pypdf openai-whisper tika 'azure-ai-formrecognizer>=3.2.0b2'

- name: Run tests
run: pytest e2e/preview
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Haystack
run: pip install .[preview,dev] langdetect transformers[torch,sentencepiece]==4.32.1 sentence-transformers>=2.2.0 pypdf openai-whisper tika 'azure-ai-formrecognizer>=3.2.0b2'
run: pip install .[preview,dev] langdetect transformers[torch,sentencepiece]==4.34.0 sentence-transformers>=2.2.0 pypdf openai-whisper tika 'azure-ai-formrecognizer>=3.2.0b2'

- name: Run
run: pytest --cov-report xml:coverage.xml --cov="haystack" -m "unit" test/preview
Expand Down Expand Up @@ -918,7 +918,7 @@ jobs:
sudo apt install ffmpeg # for local Whisper tests

- name: Install Haystack
run: pip install .[dev,preview] langdetect transformers[torch,sentencepiece]==4.32.1 'sentence-transformers>=2.2.0' pypdf openai-whisper tika 'azure-ai-formrecognizer>=3.2.0b2'
run: pip install .[dev,preview] langdetect transformers[torch,sentencepiece]==4.34.0 'sentence-transformers>=2.2.0' pypdf openai-whisper tika 'azure-ai-formrecognizer>=3.2.0b2'

- name: Run tests
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Haystack
run: pip install .[dev,preview] langdetect transformers[torch,sentencepiece]==4.32.1 'sentence-transformers>=2.2.0' pypdf openai-whisper tika 'azure-ai-formrecognizer>=3.2.0b2'
run: pip install .[dev,preview] langdetect transformers[torch,sentencepiece]==4.34.0 'sentence-transformers>=2.2.0' pypdf openai-whisper tika 'azure-ai-formrecognizer>=3.2.0b2'

- name: Run
run: pytest -m "unit" test/preview
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
sudo apt install ffmpeg # for local Whisper tests

- name: Install Haystack
run: pip install .[dev,preview] langdetect transformers[torch,sentencepiece]==4.32.1 'sentence-transformers>=2.2.0' pypdf openai-whisper tika 'azure-ai-formrecognizer>=3.2.0b2'
run: pip install .[dev,preview] langdetect transformers[torch,sentencepiece]==4.34.0 'sentence-transformers>=2.2.0' pypdf openai-whisper tika 'azure-ai-formrecognizer>=3.2.0b2'

- name: Run
run: pytest --maxfail=5 -m "integration" test/preview
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
colima start

- name: Install Haystack
run: pip install .[dev,preview] langdetect transformers[torch,sentencepiece]==4.32.1 'sentence-transformers>=2.2.0' pypdf openai-whisper tika 'azure-ai-formrecognizer>=3.2.0b2'
run: pip install .[dev,preview] langdetect transformers[torch,sentencepiece]==4.34.0 'sentence-transformers>=2.2.0' pypdf openai-whisper tika 'azure-ai-formrecognizer>=3.2.0b2'

- name: Run Tika
run: docker run -d -p 9998:9998 apache/tika:2.9.0.0
Expand Down Expand Up @@ -282,7 +282,7 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Haystack
run: pip install .[dev,preview] langdetect transformers[torch,sentencepiece]==4.32.1 'sentence-transformers>=2.2.0' pypdf openai-whisper tika 'azure-ai-formrecognizer>=3.2.0b2'
run: pip install .[dev,preview] langdetect transformers[torch,sentencepiece]==4.34.0 'sentence-transformers>=2.2.0' pypdf openai-whisper tika 'azure-ai-formrecognizer>=3.2.0b2'

- name: Run
run: pytest --maxfail=5 -m "integration" test/preview -k 'not tika'
Expand Down
2 changes: 1 addition & 1 deletion haystack/preview/components/rankers/similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
logger = logging.getLogger(__name__)


with LazyImport(message="Run 'pip install transformers[torch,sentencepiece]==4.32.1'") as torch_and_transformers_import:
with LazyImport(message="Run 'pip install transformers[torch,sentencepiece]==4.34.0'") as torch_and_transformers_import:
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer

Expand Down
2 changes: 1 addition & 1 deletion haystack/preview/components/readers/extractive.py
grantmwilliams marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from haystack.preview.lazy_imports import LazyImport

with LazyImport(
"Run 'pip install transformers[torch,sentencepiece]==4.32.1 sentence-transformers>=2.2.0'"
"Run 'pip install transformers[torch,sentencepiece]==4.34.0 sentence-transformers>=2.2.0'"
) as torch_and_transformers_import:
from transformers import AutoModelForQuestionAnswering, AutoTokenizer
from tokenizers import Encoding
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies = [
"requests",
"httpx",
"pydantic<2",
"transformers==4.32.1",
"transformers==4.34.0",
"pandas",
"rank_bm25",
"scikit-learn>=1.3.0", # TF-IDF and metrics
Expand Down Expand Up @@ -99,7 +99,7 @@ preview = [
"openai",
]
inference = [
"transformers[torch,sentencepiece]==4.32.1",
"transformers[torch,sentencepiece]==4.34.0",
"sentence-transformers>=2.2.0", # See haystack/nodes/retriever/_embedding_encoder.py, _SentenceTransformersEmbeddingEncoder
"huggingface-hub>=0.5.0",
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
enhancements:
- |
Upgrade Transformers to the latest version 4.34.0.
This version adds support for the new Mistral, Persimmon, BROS, ViTMatte, and Nougat models.