From 96155ff26000e00e99d9282bf1874e3d237e7dd1 Mon Sep 17 00:00:00 2001 From: Ross Smith Date: Wed, 13 Mar 2024 11:56:02 +0000 Subject: [PATCH 1/2] Update requirements (#390) * Update requirements * Sentence Transformer throws a different error --- dev-requirements.txt | 4 +- .../embedding/st_embedding_model.py | 3 +- .../tests/test_st_embedding_model.py | 3 +- requirements.txt | 46 +++++++++---------- 4 files changed, 27 insertions(+), 29 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index ad0656c5..2bf43fff 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,7 +1,7 @@ promptflow==1.1.1 -promptflow-tools==1.0.0 +promptflow-tools==1.3.0 pytest==8.1.1 pytest-cov==4.1.0 flake8==7.0.0 -pre-commit==3.5.0 +pre-commit==3.6.2 black==24.2.0 \ No newline at end of file diff --git a/rag_experiment_accelerator/embedding/st_embedding_model.py b/rag_experiment_accelerator/embedding/st_embedding_model.py index c44a3b39..f437a946 100644 --- a/rag_experiment_accelerator/embedding/st_embedding_model.py +++ b/rag_experiment_accelerator/embedding/st_embedding_model.py @@ -1,4 +1,3 @@ -from requests import HTTPError from sentence_transformers import SentenceTransformer from rag_experiment_accelerator.embedding.embedding_model import EmbeddingModel @@ -55,7 +54,7 @@ def __init__(self, model_name: str, dimension: int = None, **kwargs) -> None: super().__init__(name=model_name, dimension=dimension, **kwargs) try: self._model = SentenceTransformer(self.name) - except HTTPError as e: + except OSError as e: logger.error( f"Error retrieving model: {self.name}. Please check that the model name is correct and that you have an internet connection." ) diff --git a/rag_experiment_accelerator/embedding/tests/test_st_embedding_model.py b/rag_experiment_accelerator/embedding/tests/test_st_embedding_model.py index c413f643..8f0ed4a8 100644 --- a/rag_experiment_accelerator/embedding/tests/test_st_embedding_model.py +++ b/rag_experiment_accelerator/embedding/tests/test_st_embedding_model.py @@ -1,7 +1,6 @@ from unittest.mock import patch import pytest import numpy as np -from requests import HTTPError from rag_experiment_accelerator.embedding.st_embedding_model import STEmbeddingModel @@ -18,7 +17,7 @@ def test_generate_embedding(mock_sentence_transformer): def test_sentence_transformer_embedding_model_raises_non_existing_model(): - with pytest.raises(HTTPError): + with pytest.raises(OSError): STEmbeddingModel("non-existing-model", 123) diff --git a/requirements.txt b/requirements.txt index 305e2bc2..e16c7d78 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,32 +1,32 @@ -PyPDF2~=2.0 +PyPDF2~=3.0 azure-core==1.29.4 -matplotlib==3.8.0 -plotly==5.18.0 -tiktoken==0.5.1 -openai==1.3.7 -spacy==3.7.2 -scikit-learn==1.3.2 +matplotlib==3.8.3 +plotly==5.19.0 +tiktoken==0.6.0 +openai==1.13.3 +spacy==3.7.4 +scikit-learn==1.4.1post1 pytesseract==0.3.10 azure-search-documents==11.4.b11 -python-dotenv==1.0.0 -PyMuPDF==1.23.5 +python-dotenv==1.0.1 +PyMuPDF==1.23.26 docx2txt==0.8 -azure-ai-ml==1.11.1 -azure-identity==1.14.1 -textdistance==4.6.0 -azureml-mlflow==1.53.0 +azure-ai-ml==1.14.0 +azure-identity==1.15.0 +textdistance==4.6.1 +azureml-mlflow==1.55.0 fuzzywuzzy==0.18.0 -mlflow==2.10.0 +mlflow==2.11.0 rouge-score==0.1.2 -hnswlib==0.7.0 -pypdf==3.17.0 -langchain==0.0.329 -langchain-community==0.0.16 -sentence-transformers==2.2.2 -beautifulsoup4==4.12.2 -lxml==4.9.3 -unstructured==0.10.26 -datasets==2.14.6 +hnswlib==0.8.0 +pypdf==4.1.0 +langchain==0.1.9 +langchain-community==0.0.27 +sentence-transformers==2.5.1 +beautifulsoup4==4.12.3 +lxml==5.1.0 +unstructured==0.11.8 +datasets==2.18.0 evaluate==0.4.1 azure-ai-textanalytics==5.3.0 azure.ai.documentintelligence==1.0.0b1 From 3a063cb8765b36a669f58237e265a8dbee44bfe3 Mon Sep 17 00:00:00 2001 From: Julia Meshcheryakova Date: Wed, 13 Mar 2024 17:02:17 +0200 Subject: [PATCH 2/2] Update and sort requirements (#392) * Update requirements * Fix unit tests --- .../workflows/build_validation_workflow.yml | 6 +-- .github/workflows/rag_exp_acc_ci.yml | 8 +-- dev-requirements.txt | 2 +- requirements.txt | 52 +++++++++---------- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build_validation_workflow.yml b/.github/workflows/build_validation_workflow.yml index 6a3568f9..7306e9b6 100644 --- a/.github/workflows/build_validation_workflow.yml +++ b/.github/workflows/build_validation_workflow.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout Actions uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.11" - name: Load all build validation related dependencies @@ -31,7 +31,7 @@ jobs: set -e # fail on error python -m pip install --upgrade pip python -m pip install -e . -r requirements.txt -r dev-requirements.txt - + - name: Run flake shell: bash run: | @@ -43,7 +43,7 @@ jobs: pytest . --cov=. --cov-report=html --cov-config=.coveragerc - name: Publish Unit Test Results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: unit-test-results path: "htmlcov/**" diff --git a/.github/workflows/rag_exp_acc_ci.yml b/.github/workflows/rag_exp_acc_ci.yml index e2afb38e..23ccb7e3 100644 --- a/.github/workflows/rag_exp_acc_ci.yml +++ b/.github/workflows/rag_exp_acc_ci.yml @@ -23,7 +23,7 @@ jobs: AZURE_SEARCH_ADMIN_KEY: ${{ secrets.AZURE_SEARCH_ADMIN_KEY }} AZURE_SEARCH_SERVICE_ENDPOINT: ${{ secrets.AZURE_SEARCH_SERVICE_ENDPOINT }} AZURE_LANGUAGE_SERVICE_KEY: ${{ secrets.AZURE_LANGUAGE_SERVICE_KEY }} - AZURE_LANGUAGE_SERVICE_ENDPOINT: ${{ secrets.AZURE_LANGUAGE_SERVICE_ENDPOINT }} + AZURE_LANGUAGE_SERVICE_ENDPOINT: ${{ secrets.AZURE_LANGUAGE_SERVICE_ENDPOINT }} OPENAI_API_TYPE: "azure" OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_VERSION: ${{ secrets.OPENAI_API_VERSION }} @@ -39,7 +39,7 @@ jobs: - name: Checkout Actions uses: actions/checkout@v4 - name: Azure login - uses: azure/login@v1 + uses: azure/login@v2 with: creds: ${{ secrets.azure_credentials }} - name: Configure Azure ML Agent @@ -51,11 +51,11 @@ jobs: - name: execute qna step shell: bash run: | - python 02_qa_generation.py + python 02_qa_generation.py - name: execute querying step shell: bash run: | - python 03_querying.py + python 03_querying.py - name: execute evaluation step shell: bash run: | diff --git a/dev-requirements.txt b/dev-requirements.txt index 2bf43fff..71b5268b 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,4 @@ -promptflow==1.1.1 +promptflow==1.6.0 promptflow-tools==1.3.0 pytest==8.1.1 pytest-cov==4.1.0 diff --git a/requirements.txt b/requirements.txt index e16c7d78..80bf3fa6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,34 +1,34 @@ -PyPDF2~=3.0 -azure-core==1.29.4 -matplotlib==3.8.3 -plotly==5.19.0 -tiktoken==0.6.0 -openai==1.13.3 -spacy==3.7.4 -scikit-learn==1.4.1post1 -pytesseract==0.3.10 -azure-search-documents==11.4.b11 -python-dotenv==1.0.1 -PyMuPDF==1.23.26 -docx2txt==0.8 azure-ai-ml==1.14.0 +azure-ai-textanalytics==5.3.0 +azure-core==1.30.1 azure-identity==1.15.0 -textdistance==4.6.1 +azure-keyvault-secrets==4.8.* +azure-search-documents==11.4.b11 +azure.ai.documentintelligence==1.0.0b2 azureml-mlflow==1.55.0 +beautifulsoup4==4.12.3 +datasets==2.18.0 +docx2txt==0.8 +evaluate==0.4.1 fuzzywuzzy==0.18.0 -mlflow==2.11.0 -rouge-score==0.1.2 hnswlib==0.8.0 -pypdf==4.1.0 langchain==0.1.9 -langchain-community==0.0.27 -sentence-transformers==2.5.1 -beautifulsoup4==4.12.3 +langchain-community==0.0.28 +levenshtein==0.25.0 lxml==5.1.0 +matplotlib==3.8.3 +mlflow==2.11.1 +openai==1.13.3 +plotly==5.19.0 +pypdf==4.1.0 +pytesseract==0.3.10 +python-dotenv==1.0.1 +PyMuPDF==1.23.26 +PyPDF2~=3.0 +rouge-score==0.1.2 +scikit-learn==1.4.1post1 +sentence-transformers==2.5.1 +spacy==3.7.4 +textdistance==4.6.1 +tiktoken==0.6.0 unstructured==0.11.8 -datasets==2.18.0 -evaluate==0.4.1 -azure-ai-textanalytics==5.3.0 -azure.ai.documentintelligence==1.0.0b1 -levenshtein==0.25.0 -azure-keyvault-secrets==4.4.* \ No newline at end of file