Hub documentation
Webhooks
Webhooks
Webhooks๋ MLOps ๊ด๋ จ ๊ธฐ๋ฅ์ ๊ธฐ๋ฐ์ ๋๋ค. ํน์ ์ ์ฅ์ ๋๋ ํน์ ์ฌ์ฉ์/์กฐ์ง์ ์ํ ๋ชจ๋ ์ ์ฅ์(๋ณธ์ธ์ ์ ์ฅ์๋ฟ๋ง ์๋๋ผ ์ด๋ค ์ ์ฅ์๋ )์ ์๋ก์ด ๋ณ๊ฒฝ ์ฌํญ์ ์์ ํ ์ ์์ต๋๋ค.
๋ชจ๋ธ์ ์๋ ๋ณํ, ์ปค๋ฎค๋ํฐ ๋ด ๊ตฌ์ถ, ๋ชจ๋ธ/๋ฐ์ดํฐ์ /Spaces/๋ฒํท์ ๋ํ CI/CD ๊ตฌ์ถ ๋ฑ์ ์ฌ์ฉํ ์ ์์ต๋๋ค(๊ทธ ์ธ ๋ค์ํ ์ฉ๋). Webhooks๋ ๋ฆฌํฌ์งํ ๋ฆฌ ์ด๋ฒคํธ์ ๋ฐ์ํ์ฌ ๊ณ์ฐ ์์ ์ ์๋ํํ๊ธฐ ์ํด Jobs๋ฅผ ํธ๋ฆฌ๊ฑฐํ ์๋ ์์ต๋๋ค.
Webhooks์ ๋ํ ๋ฌธ์๊ฐ ์๋์ ์์ต๋๋ค. ๋๋ Webhooks์ ๋ช ๊ฐ์ง ๊ฐ๋ฅํ ์ฌ์ฉ ์ฌ๋ก๋ฅผ ๋ณด์ฌ์ฃผ๋ ๊ฐ์ด๋๋ฅผ ๋๋ฌ๋ณด์ค ์๋ ์์ต๋๋ค:
- ๋ฐ์ดํฐ์ ์ด ์ ๋ฐ์ดํธ๋ ๋๋ง๋ค ์ ๋ชจ๋ธ์ ํ์ธํ๋ํฉ๋๋ค (Python)
- LLM API๋ฅผ ์ฌ์ฉํ์ฌ Hub์ ํ ๋ก ๋ด ๋ง๋ค๊ธฐ (NodeJS)
- ๋ฉํ๋ฐ์ดํฐ ํ์ง ๋ณด๊ณ ์ ์์ฑ (Python)
- Jobs(CLI)๋ฅผ ์ฌ์ฉํ์ฌ ๋ฒํท์ ์ ํ์ผ ์ฒ๋ฆฌ
- ๊ทธ๋ฆฌ๊ณ ๋ ๋ง์ ๊ฒ์ด ์ถ๊ฐ๋ ์์ ์ ๋๋คโฆ
Webhook ์์ฑ
Webhooks ์ค์ ์์ ์ Webhook์ ์์ฑํ๊ณ ๊ธฐ์กด Webhook์ ํธ์งํ ์ ์์ต๋๋ค:

Webhooks๋ ์ ์ฅ์ ์ ๋ฐ์ดํธ, Pull Requests, ํ ๋ก , ์ ๋๊ธ์ ๊ฐ์ํ ์ ์์ต๋๋ค. Webhooks์ ๋ฐ์ํ๋ Space๋ฅผ ๋ง๋๋ ๊ฒ๋ ๊ฐ๋ฅํฉ๋๋ค!
Webhook ํ์ด๋ก๋
Webhook์ ๋ฑ๋กํ๋ฉด ์ง์ ๋ ๋์ URL์ HTTP POST ํธ์ถ์ ํตํด ์ ์ด๋ฒคํธ์ ๋ํ ์๋ฆผ์ ๋ฐ๊ฒ ๋ฉ๋๋ค. ํ์ด๋ก๋๋ JSON์ผ๋ก ์ธ์ฝ๋ฉ๋ฉ๋๋ค.
webhook ์ค์ ํ์ด์ง์ ํ๋ ํญ์์ ์ ์ก๋ ํ์ด๋ก๋์ ์ด๋ ฅ์ ๋ณผ ์ ์์ผ๋ฉฐ, ๋๋ฒ๊น ์ ์ฝ๊ฒ ํ๊ธฐ ์ํด ๊ณผ๊ฑฐ์ webhook์ ๋ค์ ์คํํ ์๋ ์์ต๋๋ค:

์๋ฅผ ๋ค์ด, Pull Request๊ฐ ์ด๋ฆด ๋์ ์ ์ฒด ํ์ด๋ก๋๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:
{
"event": {
"action": "create",
"scope": "discussion"
},
"repo": {
"type": "model",
"name": "openai-community/gpt2",
"id": "621ffdc036468d709f17434d",
"private": false,
"url": {
"web": "https://huggingface.co/openai-community/gpt2",
"api": "https://huggingface.co/api/models/openai-community/gpt2"
},
"owner": {
"id": "628b753283ef59b5be89e937"
}
},
"discussion": {
"id": "6399f58518721fdd27fc9ca9",
"title": "Update co2 emissions",
"url": {
"web": "https://huggingface.co/openai-community/gpt2/discussions/19",
"api": "https://huggingface.co/api/models/openai-community/gpt2/discussions/19"
},
"status": "open",
"author": {
"id": "61d2f90c3c2083e1c08af22d"
},
"num": 19,
"isPullRequest": true,
"changes": {
"base": "refs/heads/main"
}
},
"comment": {
"id": "6399f58518721fdd27fc9caa",
"author": {
"id": "61d2f90c3c2083e1c08af22d"
},
"content": "Add co2 emissions information to the model card",
"hidden": false,
// Note: when `hidden` is `true`, `content` will be undefined
"url": {
"web": "https://huggingface.co/openai-community/gpt2/discussions/19#6399f58518721fdd27fc9caa"
}
},
"webhook": {
"id": "6390e855e30d9209411de93b",
"version": 3
}
}์ด๋ฒคํธ
์ต์์ ์์ฑ event์ ํญ์ ์ง์ ๋๋ฉฐ ์ด๋ฒคํธ์ ์ฑ๊ฒฉ์ ๊ฒฐ์ ํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค.
๋ ๊ฐ์ ํ์ ์์ฑ์ด ์์ต๋๋ค: event.action์ event.scope์
๋๋ค.
event.scope๋ ๋ค์ ๊ฐ ์ค ํ๋๊ฐ ๋ฉ๋๋ค:
"repo"- ์ ์ฅ์ ์ ์ญ ์ด๋ฒคํธ. ๊ด๋ จaction์ ๊ฐ๋ฅํ ๊ฐ:"create","delete","update","move"."repo.content"- ์ ์ฅ์์ ์ฝํ ์ธ ์ ๋ํ ์ด๋ฒคํธ๋ก, ์๋ก์ด ์ปค๋ฐ์ด๋ ํ๊ทธ ๋ฑ์ด ํด๋น๋ฉ๋๋ค. ์๋ก ์์ฑ๋ ์ฐธ์กฐ/์ปค๋ฐ์ผ๋ก ์ธํด ์๋ก์ด Pull Request์์๋ ํธ๋ฆฌ๊ฑฐ๋ฉ๋๋ค. Buckets์ ๊ฒฝ์ฐ Git refs๊ฐ ์๋๋ผ ํ์ผ์ด ์ถ๊ฐ๋๊ฑฐ๋ ์ญ์ ๋ ๋ ํธ๋ฆฌ๊ฑฐ๋ฉ๋๋ค. ๊ด๋ จaction์ ํญ์"update"์ ๋๋ค."repo.config"- config์ ๋ํ ์ด๋ฒคํธ: Space secrets ์ ๋ฐ์ดํธ, ์ค์ ์ ๋ฐ์ดํธ, DOI ์ ๋ฐ์ดํธ, ๋นํ์ฑํ ์ฌ๋ถ ๋ฑ. ๊ด๋ จaction์ ํญ์"update"์ ๋๋ค."discussion"- ํ ๋ก ๋๋ Pull Request ์์ฑ, ์ ๋ชฉ ๋๋ ์ํ ์ ๋ฐ์ดํธ, ๋ณํฉ. ๊ด๋ จaction์ ๊ฐ๋ฅํ ๊ฐ:"create","delete","update"."discussion.comment"- ๋๊ธ ์์ฑ, ์ ๋ฐ์ดํธ ๋ฐ ์จ๊น. ๊ด๋ จaction์ ๊ฐ๋ฅํ ๊ฐ:"create","update".
ํฅํ ๋ ๋ง์ ์ค์ฝํ๊ฐ ์ถ๊ฐ๋ ์ ์์ต๋๋ค. ์๋ ค์ง์ง ์์ ์ด๋ฒคํธ๋ฅผ ์ฒ๋ฆฌํ๋ ค๋ฉด, ์นํ
ํธ๋ค๋ฌ๋ ์ขํ์ง ์ค์ฝํ์ ๋ํ ๋ชจ๋ ์์
์ ๋ ๋์ ์ค์ฝํ์ ๋ํ "update" ์์
์ผ๋ก ๊ฐ์ฃผํ ์ ์์ต๋๋ค.
์๋ฅผ ๋ค์ด, ํฅํ "repo.config.dois" ์ค์ฝํ๊ฐ ์ถ๊ฐ๋๋ฉด, ํด๋น ์ค์ฝํ๋ฅผ ๊ฐ์ง ๋ชจ๋ ์ด๋ฒคํธ๋ ์นํ
ํธ๋ค๋ฌ์์ "repo.config" ์ค์ฝํ์ ๋ํ "update" ์ก์
์ผ๋ก ๊ฐ์ฃผ๋ ์ ์์ต๋๋ค.
๋ฆฌํฌ์งํ ๋ฆฌ
webhooks์ ํ์ฌ ๋ฒ์ ์์๋ ์ด๋ฒคํธ๊ฐ ํญ์ ์ ์ฅ์์ ์ฐ๊ด๋ ์ ์์ผ๋ฏ๋ก ์ต์์ ์์ฑ repo๋ ํญ์ ์ง์ ๋ฉ๋๋ค. ์๋ฅผ ๋ค์ด, ๋ค์ ๊ฐ์ ๊ณ ๋ คํด ๋ณด๊ฒ ์ต๋๋ค:
"repo": {
"type": "model",
"name": "some-user/some-repo",
"id": "6366c000a2abcdf2fd69a080",
"private": false,
"url": {
"web": "https://huggingface.co/some-user/some-repo",
"api": "https://huggingface.co/api/models/some-user/some-repo"
},
"headSha": "c379e821c9c95d613899e8c4343e4bfee2b0c600",
"owner": {
"id": "61d2000c3c2083e1c08af22d"
}
}repo.headSha๋ ์ ์ฅ์์ main ๋ธ๋์น์์ ์ต์ ์ปค๋ฐ์ sha์
๋๋ค. event.scope๊ฐ "repo"๋ก ์์ํ๋ ๊ฒฝ์ฐ์๋ง ์ ์ก๋๋ฉฐ, ํ ๋ก ์ด๋ ๋๊ธ๊ณผ ๊ฐ์ ์ปค๋ฎค๋ํฐ ์ด๋ฒคํธ๋ Git ํ์คํ ๋ฆฌ๊ฐ ์๋ ๋ฒํท์๋ ์ ์ก๋์ง ์์ต๋๋ค.
์ฝ๋ ๋ณ๊ฒฝ ์ฌํญ
์ฝ๋ ๋ณ๊ฒฝ ์, ๋ฆฌํฌ์งํ ๋ฆฌ ์ด๋ฒคํธ์๋ ์ต์์ ์์ฑ updatedRefs๊ฐ ์ง์ ๋ฉ๋๋ค. ์ด๋ ์
๋ฐ์ดํธ๋ ์ฐธ์กฐ(reference)๋ค์ ๋ฐฐ์ด์
๋๋ค. ์์ ๊ฐ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:
"updatedRefs": [
{
"ref": "refs/heads/main",
"oldSha": "ce9a4674fa833a68d5a73ec355f0ea95eedd60b7",
"newSha": "575db8b7a51b6f85eb06eee540738584589f131c"
},
{
"ref": "refs/tags/test",
"oldSha": null,
"newSha": "575db8b7a51b6f85eb06eee540738584589f131c"
}
]์๋ก ์์ฑ๋ ์ฐธ์กฐ๋ oldSha๊ฐ null๋ก ์ค์ ๋ฉ๋๋ค. ์ญ์ ๋ ์ฐธ์กฐ๋ newSha๊ฐ null๋ก ์ค์ ๋ฉ๋๋ค.
ํน์ pull request, ์ ํ๊ทธ, ๋๋ ์ ๋ธ๋์น์ ๋ํ ์ ์ปค๋ฐ์ ๋ฐ์ํ ์ ์์ต๋๋ค.
๋ฒํท
Buckets์ Git ์ ์ฅ์๊ฐ ์๋๋๋ค. ์ปค๋ฐ, ๋ธ๋์น, ํ๊ทธ๊ฐ ์์ต๋๋ค. ๋ผ์ดํ์ฌ์ดํด ์ด๋ฒคํธ(create, delete, move ๋ฐ ๊ฐ์์ฑ ์ค์ ์
๋ฐ์ดํธ ๋ฑ)๋ ๋ค๋ฅธ ์ ์ฅ์ ์ ํ๊ณผ ๋์ผํ "repo" / "repo.config" ์ค์ฝํ๋ฅผ ์ฌ์ฉํฉ๋๋ค.
ํ์ผ ๋ณ๊ฒฝ์ "repo.content"๋ฅผ ์ฌ์ฉํ์ง๋ง, ํ์ด๋ก๋์๋ updatedRefs ๋์ updatedFiles ์์ฑ์ด ์์ต๋๋ค. ๊ธฐ์กด ํ์ผ์ ๋ฎ์ด์ฐ๋ ๊ฒฝ์ฐ "add"๋ก ๋ณด๊ณ ๋ฉ๋๋ค. ํ์ผ ํ๋๊ฐ ์ถ๊ฐ๋๊ณ ๋ค๋ฅธ ํ์ผ ํ๋๊ฐ ์ญ์ ๋ ํ์ ํ์ด๋ก๋ ์์๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:
{
"event": {
"action": "update",
"scope": "repo.content"
},
"repo": {
"type": "bucket",
"name": "some-user/some-bucket",
"id": "6366c000a2abcdf2fd69a080",
"private": false,
"url": {
"web": "https://huggingface.co/buckets/some-user/some-bucket",
"api": "https://huggingface.co/api/buckets/some-user/some-bucket"
},
"owner": {
"id": "61d2000c3c2083e1c08af22d"
}
},
"updatedFiles": [
{
"path": "data/train.txt",
"action": "add",
"xetHash": "55faef2f2f80cd1a087c35b729f228960739441d38073cd5aa4320751e137166",
"size": 20
},
{
"path": "data/old.txt",
"action": "delete"
},
...
],
"updatedFilesTruncated": true,
"webhook": {
"id": "6390e855e30d9209411de93b",
"version": 3
}
}10,000๊ฐ ํญ๋ชฉ์ ์ด๊ณผํ๋ฉด ๋ชฉ๋ก์ด ์๋ ค ๋๊ฐ๋ฉฐ updatedFilesTruncated๊ฐ true๋ก ์ค์ ๋ฉ๋๋ค. ์ด ๊ฒฝ์ฐ ์ ์ฒด ๋ด์ฉ์ ํ์ธํ๋ ค๋ฉด ๋ฒํท์ ๋์ดํ์ธ์.
Buckets์๋ ํ ๋ก ์ด๋ Pull Request๊ฐ ์์ผ๋ฏ๋ก, ํด๋น ์ด๋ฒคํธ์ ๋ํด "discussion" ๋ฐ "discussion.comment" ์ด๋ฒคํธ๋ฅผ ์ ๋ ์์ ํ์ง ์์ต๋๋ค.
ํด๋ผ์ด์ธํธ๊ฐ ์์ฒด ์๋ฒ๋ก์ ์ฝ๋ฐฑ์ ํตํด ๊ฐ์ ์ ์ผ๋ก ์ถ์ ํ๋ ๋์ ๋ฒํท์ ํ์ผ ๋ณ๊ฒฝ ์ฌํญ์ ์ง์ ์ถ์ ํ๋ ค๋ฉด, ๋ฒํท์ live follow stream๋ ์ ๊ณตํฉ๋๋ค.
์ค์ ๋ณ๊ฒฝ
์ต์์ ์์ฑ event.scope๊ฐ "repo.config"์ธ ๊ฒฝ์ฐ, updatedConfig ์์ฑ์ด ์ง์ ๋ฉ๋๋ค. ์ด ์์ฑ์ ์
๋ฐ์ดํธ๋ config๋ฅผ ํฌํจํ๋ ๊ฐ์ฒด์
๋๋ค. ๊ฐ์ ์์๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:
"updatedConfig": {
"private": false
}์ ๋ฐ์ดํธ๋ config ํค๊ฐ webhook์ ์ํด ์ง์๋์ง ์์ผ๋ฉด ๊ฐ์ฒด๊ฐ ๋น์ด ์์ต๋๋ค:
"updatedConfig": {}ํ์ฌ private๋ง ์ง์๋ฉ๋๋ค. ์ฌ๊ธฐ์ ๋ ๋ง์ config ํค๊ฐ ์กด์ฌํ๋ฉด ๋์์ด ๋๋ค๋ฉด website@huggingface.co๋ก ์๋ ค ์ฃผ์๊ธฐ ๋ฐ๋๋๋ค.
ํ ๋ก ๋ฐ Pull Requests
์ต์์ ์์ฑ discussion๋ ์ปค๋ฎค๋ํฐ ์ด๋ฒคํธ(ํ ๋ก ๋ฐ Pull Request)์ ์ง์ ๋ฉ๋๋ค. discussion.isPullRequest ์์ฑ์ ํด๋น ํ ๋ก ์ด Pull Request์ด๊ธฐ๋ ํ์ง๋ฅผ ๋ํ๋ด๋ boolean ๊ฐ์
๋๋ค(Hub์์ PR์ ํ ๋ก ์ ํน์ํ ์ ํ์
๋๋ค). ์๋๋ ์์ ๊ฐ์
๋๋ค:
"discussion": {
"id": "639885d811ae2bad2b7ba461",
"title": "Hello!",
"url": {
"web": "https://huggingface.co/some-user/some-repo/discussions/3",
"api": "https://huggingface.co/api/models/some-user/some-repo/discussions/3"
},
"status": "open",
"author": {
"id": "61d2000c3c2083e1c08af22d"
},
"isPullRequest": true,
"changes": {
"base": "refs/heads/main"
}
"num": 3
}๋๊ธ
์ต์์ ์์ฑ comment์ ๋๊ธ์ด ์์ฑ๋ ๋(ํ ๋ก ์์ฑ ํฌํจ) ๋๋ ์
๋ฐ์ดํธ๋ ๋ ์ง์ ๋ฉ๋๋ค. ๋ค์์ ์์ ๊ฐ์
๋๋ค:
"comment": {
"id": "6398872887bfcfb93a306f18",
"author": {
"id": "61d2000c3c2083e1c08af22d"
},
"content": "This adds an env key",
"hidden": false,
"url": {
"web": "https://huggingface.co/some-user/some-repo/discussions/4#6398872887bfcfb93a306f18"
}
}Webhook secret
Webhook ์ํฌ๋ฆฟ์ ์ค์ ํ๋ฉด Webhook ํธ๋ค๋ฌ URL๋ก ์ ์ก๋๋ ํ์ด๋ก๋๊ฐ ์ค์ ๋ก Hugging Face์์ ์จ ๊ฒ์ธ์ง ํ์ธํ ์ ์์ด ์ ์ฉํฉ๋๋ค.
Webhook์ ์ํฌ๋ฆฟ์ ์ค์ ํ๋ฉด ๋ชจ๋ ์์ฒญ์ X-Webhook-Secret HTTP ํค๋๋ก ํจ๊ป ์ ์ก๋ฉ๋๋ค. ASCII ๋ฌธ์๋ง ์ง์๋ฉ๋๋ค.
ํธ๋ค๋ฌ URL์ ์ํฌ๋ฆฟ์ ์ง์ ์ถ๊ฐํ๋ ๊ฒ๋ ๊ฐ๋ฅํฉ๋๋ค. ์๋ฅผ ๋ค์ด, ์ฟผ๋ฆฌ ํ๋ผ๋ฏธํฐ๋ก ์ค์ ํ๋ ๊ฒฝ์ฐ: https://example.com/webhook?secret=XXX.
Webhook ํธ๋ค๋ฌ์์ ์์ฒญ์ HTTP ํค๋์ ์ก์ธ์คํ๋ ๊ฒ์ด ๋ณต์กํ ๊ฒฝ์ฐ ์ด ๊ธฐ๋ฅ์ด ์ ์ฉํ ์ ์์ต๋๋ค.
์ ๋ฌ ๋ฐ ์ฌ์๋
Webhook ํ์ด๋ก๋๊ฐ Hub์์ ์ด๋ฒคํธ๊ฐ ๋ฐ์ํ ์งํ ๋น๋๊ธฐ์ ์ผ๋ก ์ ๋ฌ๋ฉ๋๋ค. ์์๊ฐ ๋ณด์ฅ๋์ง ์์ต๋๋ค: ์ฌ๋ฌ ์ด๋ฒคํธ๊ฐ ์งง์ ์๊ฐ ๊ฐ๊ฒฉ์ผ๋ก ๋ฐ์ํ๋ฉด ์์๋๋ก ๋์ฐฉํ์ง ์์ ์ ์์ต๋๋ค.
ํธ๋ค๋ฌ๋ 2xx ์ํ ์ฝ๋๋ก ์ ๋ฌ์ ํ์ธํด์ผ ํฉ๋๋ค. ๋ค๋ฅธ ์ํ ์ฝ๋๋ ์ฐ๊ฒฐ ์ค๋ฅ์ ๋ง์ฐฌ๊ฐ์ง๋ก ์ ๋ฌ ์คํจ๋ก ๊ฐ์ฃผ๋๋ฉฐ, ๋ฐฑ์คํ๋ฅผ ์ ์ฉํ์ฌ ์ฌ์๋๋ฉ๋๋ค. ์ฒ๋ฆฌ๊ฐ ๋๋ฆฐ ๊ฒฝ์ฐ, ์ ๋ฌ์ด ์คํจ๋ก ๊ฐ์ฃผ๋์ง ์๋๋ก ์ฆ์ 2xx๋ก ์๋ตํ๊ณ ์์
์ ๋น๋๊ธฐ์ ์ผ๋ก ์ํํ์ธ์.
๊ฐ ์ ๋ฌ์๋ ๊ณ ์ ํ Webhook-Id HTTP ํค๋๊ฐ ์์ต๋๋ค. ์คํจํ ์ ๋ฌ์ ์ฌ์๋๋ ๋์ผํ ID๋ฅผ ์ฌ์ฌ์ฉํ๋ฏ๋ก, ์ด๋ฅผ ๋ฉฑ๋ฑ์ฑ ํค๋ก ์ทจ๊ธํ์ฌ ๊ฐ ์ด๋ฒคํธ๋ฅผ ํ ๋ฒ๋ง ์ฒ๋ฆฌํ ์ ์์ต๋๋ค.
Webhook์ผ๋ก์ ์ ์ก์ด ๊ณ์ ์คํจํ๋ฉด Webhook์ด ์๋์ผ๋ก ์ค๋จ๋๊ณ ์์ ์์๊ฒ ์ด๋ฉ์ผ๋ก ์๋ฆผ์ด ์ ์ก๋ฉ๋๋ค. ์ค์ ์์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ณ ๋ค์ ํ์ฑํํ ์ ์์ต๋๋ค.
์์ฒญ ์ ํ
๊ฐ Webhook์ 24์๊ฐ๋น 1,000ํ ํธ๋ฆฌ๊ฑฐ๋ก ์ ํ๋ฉ๋๋ค. ์ฌ์ฉ๋์ Webhook ์ค์ ํ์ด์ง์ โActivityโ ํญ์์ ํ์ธํ ์ ์์ต๋๋ค.
Webhook์ ํธ๋ฆฌ๊ฑฐ ์๋ฅผ ๋๋ ค์ผ ํ๋ ๊ฒฝ์ฐ, PRO, Team ๋๋ Enterprise๋ก ์ ๊ทธ๋ ์ด๋ํ ํ website@huggingface.co๋ก ๋ฌธ์ํด ์ฃผ์ธ์.
Webhook ๊ฐ๋ฐํ๊ธฐ
HTTPS ์๋ํฌ์ธํธ/URL์ด ์๋ ๊ฒฝ์ฐ, ์นํ ํ ์คํธ๋ฅผ ์ํ ๊ณต๊ฐ ๋๊ตฌ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ด๋ฌํ ๋๊ตฌ๋ ์์ ๋ ๋ชจ๋ ์์ฒญ์ ์บก์ฒํ๋ catch-all ์ญํ ์ ํ๋ฉฐ 200 OK ์ํ ์ฝ๋๋ฅผ ๋ฐํํฉ๋๋ค. Beeceptor๋ ์์ HTTP ์๋ํฌ์ธํธ๋ฅผ ์์ฑํ๊ณ ์์ ๋ ํ์ด๋ก๋๋ฅผ ๊ฒํ ํ๋ ๋ฐ ์ฌ์ฉํ ์ ์๋ ๋๊ตฌ ์ค ํ๋์ ๋๋ค. ๋ ๋ค๋ฅธ ์ ์ฌํ ๋๊ตฌ๋ Webhook.site์ ๋๋ค.
๋ํ, ๊ฐ๋ฐ ์ค์๋ ์ค์ Webhook ํ์ด๋ก๋๋ฅผ ๋ก์ปฌ ๋จธ์ ์์ ์คํ ์ค์ธ ์ฝ๋๋ก ๋ผ์ฐํ ํ ์ ์์ต๋๋ค. ์ด๋ ๋ ๋น ๋ฅธ ํตํฉ์ ์ํด ํ ์คํธ ๋ฐ ๋๋ฒ๊น ์ ์ํํ๋ ์ข์ ๋ฐฉ๋ฒ์ ๋๋ค. ์ด๋ฅผ ์ํด ๋ก์ปฌํธ์คํธ ํฌํธ๋ฅผ ์ธํฐ๋ท์ ๋ ธ์ถํ๋ฉด ๋ฉ๋๋ค. ์ด ๊ฒฝ๋ก๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ngrok ๋๋ localtunnel์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
Webhook ๋๋ฒ๊น
์นํ ์์ ์ต๊ทผ ์์ฑ๋ ์ด๋ฒคํธ๋ฅผ ์ฝ๊ฒ ์ฐพ์ ์ ์์ต๋๋ค. ์นํ ์ activity ํญ์ ์ด๋ฉด ์ต๊ทผ ์ด๋ฒคํธ ๋ชฉ๋ก์ ๋ณผ ์ ์์ต๋๋ค.

์ฌ๊ธฐ์์ ์์ฑ๋ ์ด๋ฒคํธ์ HTTP ์ํ ์ฝ๋์ ํ์ด๋ก๋๋ฅผ ๊ฒํ ํ ์ ์์ต๋๋ค. ๋ํ, Replay ๋ฒํผ์ ํด๋ฆญํ์ฌ ์ด๋ฌํ ์ด๋ฒคํธ๋ฅผ ๋ค์ ์ฌ์ํ ์ ์์ต๋๋ค!
Note: Webhook์ ๋์ URL ๋๋ secret์ ๋ณ๊ฒฝํ ๊ฒฝ์ฐ, ์ด๋ฒคํธ๋ฅผ ์ฌ์ํ๋ฉด payload๊ฐ ์ ๋ฐ์ดํธ๋ URL๋ก ์ ์ก๋ฉ๋๋ค.
์ฐธ๊ณ : ์ฌ์ ์ก๋ ์ด๋ฒคํธ๋ ์๋ ์ ๋ฌ๊ณผ ๋์ผํ Webhook-Id๋ก ์ ์ก๋ฉ๋๋ค.
์์ฃผ ๋ฌป๋ ์ง๋ฌธ
์กฐ์ง ๊ณ์ ๊ณผ ์ฌ์ฉ์ ๊ณ์ ์ค ์ด๋์ ์นํ ์ ์ ์ํ ์ ์๋์?
์๋์, ํ์ฌ๋ ์ง์๋์ง ์์ต๋๋ค.
HF(๋๋ ๋ชจ๋ ๋ชจ๋ธ๊ณผ ๊ฐ์ ์ ์ฒด ์ ์ฅ์ ์ ํ)์ ๋ชจ๋ ์ด๋ฒคํธ์ ๊ตฌ๋ ํ๋ ๋ฐฉ๋ฒ์ ๋ฌด์์ธ๊ฐ์?
ํ์ฌ ์ต์ข ์ฌ์ฉ์์๊ฒ ๋ ธ์ถ๋์ง ์์ง๋ง, website@huggingface.co๋ก ์ด๋ฉ์ผ์ ๋ณด๋ด์ฃผ์๋ฉด ํด๋น ์ค์ ์ ๋ณ๊ฒฝํด ๋๋ฆด ์ ์์ต๋๋ค.
Update on GitHub