Skip to content

Notebook Execution and Error Check #172

Notebook Execution and Error Check

Notebook Execution and Error Check #172

name: Notebook Execution and Error Check
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch: # This enables manual triggering
jobs:
execute_notebooks:
runs-on: ubuntu-latest
strategy:
matrix:
# this line is automatically generated by the script in .github/workflows/scripts/update_notebook_matrix.sh
notebook: ["bug_free_python_code.ipynb","check_for_pii.ipynb","competitors_check.ipynb","extracting_entities.ipynb","generate_structured_data.ipynb","generate_structured_data_cohere.ipynb","guardrails_with_chat_models.ipynb","input_validation.ipynb","llamaindex-output-parsing.ipynb","no_secrets_in_generated_text.ipynb","provenance.ipynb","recipe_generation.ipynb","regex_validation.ipynb","response_is_on_topic.ipynb","secrets_detection.ipynb","select_choice_based_on_action.ipynb","streaming.ipynb","syntax_error_free_sql.ipynb","text_summarization_quality.ipynb","toxic_language.ipynb","translation_to_specific_language.ipynb","translation_with_quality_check.ipynb","valid_chess_moves.ipynb","value_within_distribution.ipynb"]
env:
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }}
NLTK_DATA: /tmp/nltk_data
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11.x
- name: Poetry cache
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install dependencies
run: |
make full;
poetry add "openai>=1.2.4" jupyter nbconvert cohere;
- name: Check for pypdfium2
run: poetry run pip show pypdfium2
- name: Huggingface Hub Login
run: poetry run huggingface-cli login --token $HUGGINGFACE_API_KEY
- name: download nltk data
run: |
mkdir /tmp/nltk_data;
poetry run python -m nltk.downloader -d /tmp/nltk_data punkt;
- name: Use venv
run: source $VENV
- name: Execute notebooks and check for errors
run: bash ./.github/workflows/scripts/run_notebooks.sh ${{ matrix.notebook }}