name: Sync to Hugging Face hub on: push: branches: [main] # to run this workflow manually from the Actions tab workflow_dispatch: jobs: run-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 # Installing dependencies - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.9' - name: Install dependencies run: | python -m pip install --upgrade pip pip install pytest pip install pydantic==2.8.2 pip install pydantic-core==2.20.1 pip install fastapi==0.112.4 pip install gradio==3.23.0 pip install transformers torch huggingface_hub pip install accelerate # Run unit tests with pytest - name: Run tests run: | pytest sync-to-hub: runs-on: ubuntu-latest needs: run-tests steps: - uses: actions/checkout@v3 with: fetch-depth: 0 lfs: true - name: Push to hub env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: git push https://MLOps-J-A-E:$HF_TOKEN@huggingface.co/spaces/MLOps-J-A-E/Wormington-Scholar-Chatbot main