Buckets:

|
download
raw
11.5 kB

Discussions 및 Pull Requests를 이용하여 상호작용하기[[interacting-with-discussions-and-pull-requests]]

Hub에서 Discussions 및 Pull Requests를 이용하여 상호 작용할 수 있는 방법에 대해 참조하고자 한다면 HfApi 문서 페이지를 확인하세요.

데이터 구조[[huggingface_hub.Discussion]][[huggingface_hub.Discussion]]

huggingface_hub.Discussion[[huggingface_hub.Discussion]]

huggingface_hub.Discussion(title: str, status: typing.Literal['open', 'closed', 'merged', 'draft'], num: int, repo_id: str, repo_type: str, author: str, is_pull_request: bool, created_at: datetime, endpoint: str)

Source

Parameters:

title (str) : The title of the Discussion / Pull Request

status (str) : The status of the Discussion / Pull Request. It must be one of: * "open" * "closed" * "merged" (only for Pull Requests ) * "draft" (only for Pull Requests )

num (int) : The number of the Discussion / Pull Request.

repo_id (str) : The id ("{namespace}/{repo_name}") of the repo on which the Discussion / Pull Request was open.

repo_type (str) : The type of the repo on which the Discussion / Pull Request was open. Possible values are: "model", "dataset", "space".

author (str) : The username of the Discussion / Pull Request author. Can be "deleted" if the user has been deleted since.

is_pull_request (bool) : Whether or not this is a Pull Request.

created_at (datetime) : The datetime of creation of the Discussion / Pull Request.

endpoint (str) : Endpoint of the Hub. Default is https://huggingface.co.

git_reference (str, optional) : (property) Git reference to which changes can be pushed if this is a Pull Request, None otherwise.

url (str) : (property) URL of the discussion on the Hub.

A Discussion or Pull Request on the Hub.

This dataclass is not intended to be instantiated directly.

huggingface_hub.DiscussionWithDetails[[huggingface_hub.DiscussionWithDetails]]

huggingface_hub.DiscussionWithDetails(title: str, status: typing.Literal['open', 'closed', 'merged', 'draft'], num: int, repo_id: str, repo_type: str, author: str, is_pull_request: bool, created_at: datetime, endpoint: str, events: list, conflicting_files: list[str] | bool | None, target_branch: str | None, merge_commit_oid: str | None, diff: str | None)

Source

Parameters:

title (str) : The title of the Discussion / Pull Request

status (str) : The status of the Discussion / Pull Request. It can be one of: * "open" * "closed" * "merged" (only for Pull Requests ) * "draft" (only for Pull Requests )

num (int) : The number of the Discussion / Pull Request.

repo_id (str) : The id ("{namespace}/{repo_name}") of the repo on which the Discussion / Pull Request was open.

repo_type (str) : The type of the repo on which the Discussion / Pull Request was open. Possible values are: "model", "dataset", "space".

author (str) : The username of the Discussion / Pull Request author. Can be "deleted" if the user has been deleted since.

is_pull_request (bool) : Whether or not this is a Pull Request.

created_at (datetime) : The datetime of creation of the Discussion / Pull Request.

events (list of DiscussionEvent) : The list of DiscussionEvents in this Discussion or Pull Request.

conflicting_files (Union[list[str], bool, None], optional) : A list of conflicting files if this is a Pull Request. None if self.is_pull_request is False. True if there are conflicting files but the list can't be retrieved.

target_branch (str, optional) : The branch into which changes are to be merged if this is a Pull Request . None if self.is_pull_request is False.

merge_commit_oid (str, optional) : If this is a merged Pull Request , this is set to the OID / SHA of the merge commit, None otherwise.

diff (str, optional) : The git diff if this is a Pull Request , None otherwise.

endpoint (str) : Endpoint of the Hub. Default is https://huggingface.co.

git_reference (str, optional) : (property) Git reference to which changes can be pushed if this is a Pull Request, None otherwise.

url (str) : (property) URL of the discussion on the Hub.

Subclass of Discussion.

huggingface_hub.DiscussionEvent[[huggingface_hub.DiscussionEvent]]

huggingface_hub.DiscussionEvent(id: str, type: str, created_at: datetime, author: str, _event: dict)

Source

Parameters:

id (str) : The ID of the event. An hexadecimal string.

type (str) : The type of the event.

created_at (datetime) : A datetime object holding the creation timestamp for the event.

author (str) : The username of the Discussion / Pull Request author. Can be "deleted" if the user has been deleted since.

An event in a Discussion or Pull Request.

Use concrete classes:

huggingface_hub.DiscussionComment[[huggingface_hub.DiscussionComment]]

huggingface_hub.DiscussionComment(id: str, type: str, created_at: datetime, author: str, _event: dict, content: str, edited: bool, hidden: bool)

Source

Parameters:

id (str) : The ID of the event. An hexadecimal string.

type (str) : The type of the event.

created_at (datetime) : A datetime object holding the creation timestamp for the event.

author (str) : The username of the Discussion / Pull Request author. Can be "deleted" if the user has been deleted since.

content (str) : The raw markdown content of the comment. Mentions, links and images are not rendered.

edited (bool) : Whether or not this comment has been edited.

hidden (bool) : Whether or not this comment has been hidden.

A comment in a Discussion / Pull Request.

Subclass of DiscussionEvent.

huggingface_hub.DiscussionStatusChange[[huggingface_hub.DiscussionStatusChange]]

huggingface_hub.DiscussionStatusChange(id: str, type: str, created_at: datetime, author: str, _event: dict, new_status: str)

Source

Parameters:

id (str) : The ID of the event. An hexadecimal string.

type (str) : The type of the event.

created_at (datetime) : A datetime object holding the creation timestamp for the event.

author (str) : The username of the Discussion / Pull Request author. Can be "deleted" if the user has been deleted since.

new_status (str) : The status of the Discussion / Pull Request after the change. It can be one of: * "open" * "closed" * "merged" (only for Pull Requests )

A change of status in a Discussion / Pull Request.

Subclass of DiscussionEvent.

huggingface_hub.DiscussionCommit[[huggingface_hub.DiscussionCommit]]

huggingface_hub.DiscussionCommit(id: str, type: str, created_at: datetime, author: str, _event: dict, summary: str, oid: str)

Source

Parameters:

id (str) : The ID of the event. An hexadecimal string.

type (str) : The type of the event.

created_at (datetime) : A datetime object holding the creation timestamp for the event.

author (str) : The username of the Discussion / Pull Request author. Can be "deleted" if the user has been deleted since.

summary (str) : The summary of the commit.

oid (str) : The OID / SHA of the commit, as a hexadecimal string.

A commit in a Pull Request.

Subclass of DiscussionEvent.

huggingface_hub.DiscussionTitleChange[[huggingface_hub.DiscussionTitleChange]]

huggingface_hub.DiscussionTitleChange(id: str, type: str, created_at: datetime, author: str, _event: dict, old_title: str, new_title: str)

Source

Parameters:

id (str) : The ID of the event. An hexadecimal string.

type (str) : The type of the event.

created_at (datetime) : A datetime object holding the creation timestamp for the event.

author (str) : The username of the Discussion / Pull Request author. Can be "deleted" if the user has been deleted since.

old_title (str) : The previous title for the Discussion / Pull Request.

new_title (str) : The new title.

A rename event in a Discussion / Pull Request.

Subclass of DiscussionEvent.

Xet Storage Details

Size:
11.5 kB
·
Xet hash:
d31275a2f849e94ac3a89d908516fbf439f6181fe79164561d061b4ccfc4a371

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.