Skip to content

with pakcage json

with pakcage json #3

name: Update Inference Types
on:
workflow_dispatch:
push:
branches:
- add-workflow-update-inference-types
concurrency:
group: update-inference-types
cancel-in-progress: true
jobs:
pull_request:
runs-on: ubuntu-latest
steps:
# Setup Python
- uses: actions/checkout@v3
with:
repository: huggingface/huggingface_hub
path: ./huggingface_hub
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Setup uv
run: |
pip install --upgrade uv
- name: Install dependencies
run: uv pip install --system "huggingface_hub[dev] @ ."
working-directory: ./huggingface_hub
# Setup JS
- uses: actions/checkout@v3
with:
repository: huggingface/huggingface.js
path: huggingface.js
- uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
package_json_file: ./huggingface.js/packages/tasks/package.json
- name: Install dependencies
run: pnpm install
working-directory: ./huggingface.js/packages/tasks
# Generate specs
- run: pnpm run inference-codegen
working-directory: ./huggingface.js/packages/tasks
# Copy Python types to huggingface_hub
- run: cp -r ./huggingface.js/packages/tasks/.python_generated/* ./huggingface_hub/src/huggingface_hub/inference/_generated/types
# Post-process
- run: make inference_update
working-directory: ./huggingface_hub
- run: make style
working-directory: ./huggingface_hub
# Check changes
- run: git status
working-directory: ./huggingface_hub
# Create or update Pull Request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
path: ./huggingface_hub
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update inference types (automated commit)
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
branch: update-inferene-types-automated-pr
delete-branch: true
title: "[Bot] Update inference types"
body: |
This PR updates the inference types. It has been generated by running:
```sh
# Generate Python code
pnpm run inference-codegen # from huggingface.js
# Copy to this repository
cp -r ./huggingface.js/packages/tasks/.python_generated/* ./huggingface_hub/src/huggingface_hub/inference/_generated/types
# Clean things
make inference_update
make style
```
This PR was automatically created by the [Update Inference Types workflow](https://github.com/huggingface/huggingface_hub/blob/main/.github/update-inference-types.yml).
Make sure the changes are correct before merging.
labels: |
specs
reviewers: |
Wauplin
hanouticelina