Hub Python Library documentation

ディスカッションとプルリクエストとのやり取り

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

ディスカッションとプルリクエストとのやり取り

Hub での Pull Request および Discussion とのやり取りを可能にするメソッドの参考情報については、HfApi のドキュメントページを確認してください。

データ構造

クラス huggingface_hub.Discussion

< >

( title: strstatus: typing.Literal['open', 'closed', 'merged', 'draft']num: intrepo_id: strrepo_type: strauthor: stris_pull_request: boolcreated_at: datetimeendpoint: str )

パラメータ

  • title (str) — Discussion / Pull Request のタイトル
  • status (str) — Discussion / Pull Request のステータスです。 以下のいずれかである必要があります:
    • "open"
    • "closed"
    • "merged"(Pull Requests のみ)
    • "draft"(Pull Request のみ)
  • num (int) — Discussion / Pull Request の番号です。
  • repo_id (str) — Discussion / Pull Request がオープンされていたリポジトリの ID ("{namespace}/{repo_name}")。
  • repo_type (str) — Discussion / Pull Request がオープンされていたリポジトリの種類。 取り得る値は: "model"、"dataset"、"space"。
  • author (str) — Discussion / Pull Request の作成者のユーザー名です。 ユーザーがその後削除されている場合は、"deleted" になる可能性があります。
  • is_pull_request (bool) — Pull Request かどうかを示します。
  • created_at (datetime) — Discussion / Pull Request が作成された時刻の datetime です。
  • endpoint (str) — Hub のエンドポイントです。デフォルトは https://huggingface.co です。
  • git_reference (str, 省略可) — (property) これが Pull Request の場合、変更をプッシュできる Git リファレンス。それ以外の場合は None。
  • url (str) — プロパティ。Hub 上のディスカッションの URL。

Hub でのディスカッションまたは Pull Request。

このデータクラスは、直接インスタンス化することを意図していません。

クラス huggingface_hub.DiscussionWithDetails

< >

( title: strstatus: typing.Literal['open', 'closed', 'merged', 'draft']num: intrepo_id: strrepo_type: strauthor: stris_pull_request: boolcreated_at: datetimeendpoint: strevents: listconflicting_files: list[str] | bool | Nonetarget_branch: str | Nonemerge_commit_oid: str | Nonediff: str | None )

パラメータ

  • title (str) — Discussion / Pull Request のタイトル
  • status (str) — Discussion / Pull Request のステータス。以下のいずれかになります:
    • "open"
    • "closed"
    • "merged"(Pull Requests のみ)
    • "draft"(Pull Request のみ)
  • num (int) — Discussion / Pull Request の番号です。
  • repo_id (str) — Discussion / Pull Request がオープンされていたリポジトリの ID ("{namespace}/{repo_name}")。
  • repo_type (str) — Discussion / Pull Request がオープンされていたリポジトリの種類。 取り得る値は: "model"、"dataset"、"space"。
  • author (str) — Discussion / Pull Request の作成者のユーザー名です。 ユーザーがその後削除されている場合は、"deleted" になる可能性があります。
  • is_pull_request (bool) — Pull Request かどうかを示します。
  • created_at (datetime) — Discussion / Pull Request が作成された時刻の datetime です。
  • events (list of DiscussionEvent) — この Discussion または Pull Request に含まれる DiscussionEvents のリストです。
  • conflicting_files (Union[list[str], bool, None], 省略可) — Pull Request の場合、競合するファイルのリストです。 self.is_pull_request が False の場合は None です。 競合するファイルが存在するが、リストを取得できない場合は True です。
  • target_branch (str, 省略可) — Pull Request の場合、変更がマージされるブランチ。self.is_pull_request が False の場合は None。
  • merge_commit_oid (str, 任意) — マージされた Pull Request の場合、マージコミットの OID / SHA が設定され、それ以外の場合は None になります。
  • diff (str, optional) — Pull Request の場合は git diff、それ以外は None。
  • endpoint (str) — Hub のエンドポイントです。デフォルトは https://huggingface.co です。
  • git_reference (str, 省略可) — (property) これが Pull Request の場合、変更をプッシュできる Git リファレンス。それ以外の場合は None。
  • url (str) — プロパティ。Hub 上のディスカッションの URL。

Discussionのサブクラスです。

クラス huggingface_hub.DiscussionEvent

< >

( id: strtype: strcreated_at: datetimeauthor: str_event: dict )

パラメータ

  • id (str) — イベントのIDです。16進数文字列です。
  • type (str) — イベントの種類。
  • created_at (datetime) — イベントの作成タイムスタンプを保持するdatetimeオブジェクト。
  • author (str) — Discussion / Pull Request の作成者のユーザー名です。 ユーザーがその後削除されている場合は、"deleted" になる可能性があります。

DiscussionまたはPull Request内のイベント。

具体的なクラスを使用します:

クラス huggingface_hub.DiscussionComment

< >

( id: strtype: strcreated_at: datetimeauthor: str_event: dictcontent: stredited: boolhidden: bool )

パラメータ

  • id (str) — イベントのIDです。16進数文字列です。
  • type (str) — イベントの種類。
  • created_at (datetime) — イベントの作成タイムスタンプを保持するdatetimeオブジェクト。
  • author (str) — Discussion / Pull Request の作成者のユーザー名です。 ユーザーがその後削除されている場合は、"deleted" になる可能性があります。
  • content (str) — コメントの生の Markdown 内容です。メンション、リンク、画像はレンダリングされません。
  • edited (bool) — このコメントが編集されたかどうかを示します。
  • hidden (bool) — このコメントが非表示かどうかを示します。

Discussion / Pull Request 内のコメント。

DiscussionEventのサブクラスです。

クラス huggingface_hub.DiscussionStatusChange

< >

( id: strtype: strcreated_at: datetimeauthor: str_event: dictnew_status: str )

パラメータ

  • id (str) — イベントのIDです。16進数文字列です。
  • type (str) — イベントの種類。
  • created_at (datetime) — イベントの作成タイムスタンプを保持するdatetimeオブジェクト。
  • author (str) — Discussion / Pull Request の作成者のユーザー名です。 ユーザーがその後削除されている場合は、"deleted" になる可能性があります。
  • new_status (str) — 変更後の Discussion / Pull Request のステータスです。以下のいずれかになります:
    • "open"
    • "closed"
    • "merged"(Pull Requests のみ)

Discussion / Pull Request におけるステータスの変更。

DiscussionEventのサブクラスです。

クラス huggingface_hub.DiscussionCommit

< >

( id: strtype: strcreated_at: datetimeauthor: str_event: dictsummary: stroid: str )

パラメータ

  • id (str) — イベントのIDです。16進数文字列です。
  • type (str) — イベントの種類。
  • created_at (datetime) — イベントの作成タイムスタンプを保持するdatetimeオブジェクト。
  • author (str) — Discussion / Pull Request の作成者のユーザー名です。 ユーザーがその後削除されている場合は、"deleted" になる可能性があります。
  • summary (str) — コミットの概要です。
  • oid (str) — コミットの OID / SHA を16進数文字列として表したものです。

Pull Request 内のコミット。

DiscussionEventのサブクラスです。

class huggingface_hub.DiscussionTitleChange

< >

( id: strtype: strcreated_at: datetimeauthor: str_event: dictold_title: strnew_title: str )

パラメータ

  • id (str) — イベントのIDです。16進数文字列です。
  • type (str) — イベントの種類。
  • created_at (datetime) — イベントの作成タイムスタンプを保持するdatetimeオブジェクト。
  • author (str) — Discussion / Pull Request の作成者のユーザー名です。 ユーザーがその後削除されている場合は、"deleted" になる可能性があります。
  • old_title (str) — Discussion / Pull Request の以前のタイトルです。
  • new_title (str) — 新しいタイトル。

Discussion / Pull Request における名前変更イベント。

DiscussionEventのサブクラスです。

Update on GitHub