Skip to main content

Hugging Face

ShanoneのHugging Face連携では、Hubのほぼ全機能——モデル、データセット、Spaces、サーバーレス推論、推論エンドポイント、コレクション、議論/PR、論文、リポジトリ操作、セキュリティスキャン、Webhookを扱う87のツールをエージェントが利用できるようになります。

はじめに

1

Hugging Face アクセストークンを取得する

Hugging FaceアカウントのSettings → Access Tokensからトークンを生成します。
2

Shanoneに登録する

ShanoneダッシュボードのIntegrationsを開き、Hugging Faceを選択してアクセストークンを貼り付けます。
3

リクエストを再試行する

保存が完了すると、huggingface_*ツールへのshanone_execute_tool呼び出しが成功するようになります。

利用可能なツール

ShanoneはHugging Face用に87のツールを提供しており、以下のカテゴリに分類されています。
huggingface_list_models, huggingface_get_model_info, huggingface_list_user_models, huggingface_create_model_repo, huggingface_delete_model_repo, huggingface_update_model_settings
huggingface_list_datasets, huggingface_get_dataset_info, huggingface_create_dataset_repo, huggingface_delete_dataset_repo, huggingface_get_dataset_rows, huggingface_filter_dataset_rows, huggingface_search_dataset, huggingface_get_dataset_statistics, huggingface_get_dataset_splits, huggingface_get_dataset_size, huggingface_list_parquet_files
huggingface_list_spaces, huggingface_get_space_info, huggingface_create_space_repo, huggingface_delete_space_repo, huggingface_restart_space, huggingface_pause_space
huggingface_text_generation, huggingface_text_classification, huggingface_feature_extraction, huggingface_chat_completion, huggingface_image_classification, huggingface_summarization, huggingface_text_to_image, huggingface_image_to_text, huggingface_translation, huggingface_question_answering, huggingface_zero_shot_classification, huggingface_token_classification, huggingface_fill_mask, huggingface_automatic_speech_recognition
huggingface_list_inference_endpoints, huggingface_get_inference_endpoint, huggingface_create_inference_endpoint, huggingface_update_inference_endpoint, huggingface_delete_inference_endpoint, huggingface_pause_inference_endpoint, huggingface_resume_inference_endpoint, huggingface_scale_inference_endpoint
huggingface_create_branch, huggingface_delete_branch, huggingface_create_tag, huggingface_delete_tag, huggingface_list_repo_refs, huggingface_list_commits, huggingface_list_repo_files
huggingface_create_collection, huggingface_list_collections, huggingface_get_collection, huggingface_add_to_collection, huggingface_remove_from_collection, huggingface_delete_collection
huggingface_create_discussion, huggingface_list_discussions, huggingface_get_discussion, huggingface_create_discussion_comment, huggingface_change_discussion_status, huggingface_merge_pull_request
huggingface_search_papers, huggingface_get_daily_papers, huggingface_get_paper, huggingface_list_paper_comments, huggingface_create_paper_comment
huggingface_get_security_scan, huggingface_request_repo_access, huggingface_list_access_requests, huggingface_handle_access_request
huggingface_get_organization, huggingface_list_organization_members, huggingface_get_organization_repos, huggingface_get_user_info
huggingface_create_webhook, huggingface_list_webhooks, huggingface_get_webhook, huggingface_update_webhook, huggingface_enable_webhook, huggingface_disable_webhook, huggingface_delete_webhook, huggingface_get_billing_usage, huggingface_get_compute_usage, huggingface_get_storage_usage

よくある使い方

モデル/データセットの調査

タスクやタグでモデル・データセットを検索し、用途に最も適したものを要約する

サーバーレス推論

自前のモデルをホストせずにテキスト生成・分類・画像タスクを直接実行する

エンドポイントのライフサイクル管理

専用の推論エンドポイントを立ち上げ、スケールし、アイドル時は一時停止してコストを抑える

リポジトリメンテナンス

ブランチ/タグを管理し、議論やPRをレビューし、マージ前にセキュリティスキャン結果を確認する

トラブルシューティング

サーバーレス推論APIのモデルはコールドスタート状態でロードが必要な場合があります——少し待ってから再試行するか、頻繁に呼び出すモデルにはhuggingface_create_inference_endpointを使ってコールドスタートを完全に回避してください。
行単位で大きなデータセット全体をページングするより、具体的な条件を指定したhuggingface_filter_dataset_rows、またはhuggingface_list_parquet_filesと独自処理の組み合わせを優先してください。
組織のネームスペース下でリポジトリを作成するには、トークンのアカウントがその組織の書き込み権限を持つメンバーである必要があります——huggingface_list_organization_membersで確認するか、代わりに個人のネームスペース下で作成してください。