|
6 | 6 | workflow_dispatch: # This enables manual triggering |
7 | 7 |
|
8 | 8 | jobs: |
9 | | - execute_notebooks: |
| 9 | + setup: |
10 | 10 | runs-on: ubuntu-latest |
11 | | - |
12 | 11 | env: |
13 | 12 | COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }} |
14 | 13 | OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
15 | 14 | HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }} |
16 | | - |
17 | | - |
18 | 15 | steps: |
19 | 16 | - name: Checkout repository |
20 | | - uses: actions/checkout@v2 |
21 | | - |
| 17 | + uses: actions/checkout@v2 |
22 | 18 | - name: Set up Python |
23 | 19 | uses: actions/setup-python@v2 |
24 | | - with: |
| 20 | + with: |
25 | 21 | python-version: 3.11.x |
26 | | - |
27 | 22 | - name: Poetry cache |
28 | 23 | uses: actions/cache@v3 |
29 | 24 | with: |
30 | 25 | path: ~/.cache/pypoetry |
31 | 26 | key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }} |
32 | | - |
33 | 27 | - name: Install Poetry |
34 | 28 | uses: snok/install-poetry@v1 |
35 | 29 | with: |
36 | | - virtualenvs-create: true |
37 | | - virtualenvs-in-project: true |
38 | | - installer-parallel: true |
39 | | - |
| 30 | + virtualenvs-create: true |
| 31 | + virtualenvs-in-project: true |
| 32 | + installer-parallel: true |
40 | 33 | - name: Install dependencies |
41 | 34 | run: | |
42 | 35 | make full; |
43 | 36 | poetry add openai==0.28.1 jupyter nbconvert cohere; |
44 | | - # pip install openai==0.28.1 jupyter nbconvert; |
45 | | - # pip install .; |
46 | | -
|
47 | 37 | - name: Check for pypdfium2 |
48 | 38 | run: poetry run pip show pypdfium2 |
49 | | - |
50 | 39 | - name: Huggingface Hub Login |
51 | | - run: huggingface-cli login --token $HUGGINGFACE_API_KEY |
| 40 | + run: poetry run huggingface-cli login --token $HUGGINGFACE_API_KEY |
| 41 | + - name: download nltk data |
| 42 | + run: | |
| 43 | + mkdir /tmp/nltk_data; |
| 44 | + poetry run python -m nltk.downloader -d /tmp/nltk_data punkt; |
| 45 | + - name: Upload artifacts |
| 46 | + uses: actions/upload-artifact@v3 |
| 47 | + with: |
| 48 | + path: | |
| 49 | + /tmp/nltk_data |
| 50 | + ./.venv |
| 51 | + ./guardrails |
| 52 | + ~/.cache/pypoetry |
| 53 | + |
| 54 | + execute_notebooks: |
| 55 | + runs-on: ubuntu-latest |
| 56 | + needs: setup |
| 57 | + strategy: |
| 58 | + matrix: |
| 59 | + notebook: [ "*.ipynb" ] |
| 60 | + env: |
| 61 | + COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }} |
| 62 | + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 63 | + HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }} |
| 64 | + NLTK_DATA: /tmp/nltk_data |
| 65 | + |
52 | 66 |
|
| 67 | + steps: |
| 68 | + - name: Download artifacts |
| 69 | + uses: actions/download-artifact@v3 |
| 70 | + with: |
| 71 | + name: setup-artifacts |
| 72 | + - name: Use venv |
| 73 | + run: source .venv/bin/activate |
53 | 74 | - name: Execute notebooks and check for errors |
54 | | - run: ./.github/workflows/scripts/run_notebooks.sh |
| 75 | + run: bash ./.github/workflows/scripts/run_notebooks.sh ${{ matrix.notebook }} |
55 | 76 |
|
0 commit comments