huggingface / huggingface.js

Utilities to use the Hugging Face Hub API
https://hf.co/docs/huggingface.js
MIT License
1.37k stars 213 forks source link

[Tasks] Fix undefined `model.tags` check in tasks snippets #940

Closed hanouticelina closed 2 days ago

hanouticelina commented 2 days ago

this PR fixes a small bug when getting the task snippets to generate the inference API docs in hub-docs/scripts/api-inference/scripts/generate.ts. when generating the documentation with the latest version of huggingface/tasks, I got the following error:

if (model.tags.includes("conversational")) {
                 ^
TypeError: Cannot read properties of undefined (reading 'includes')

Changes made:

hanouticelina commented 2 days ago

my bad 😬 tags is required and cannot be underfined, the changes will be made in hub-docs/scripts/api-inference/scripts/generate.ts. I will close this PR, sorry