可以添加 huggingface.co 镜像下载么 #1

Closed
opened 2024-12-23 21:06:51 +08:00 by appotry · 4 comments
appotry commented 2024-12-23 21:06:51 +08:00 (Migrated from github.com)

huggingface.co 的git下载让人火大,类似下面这样的

git clone https://huggingface.co/spaces/cocktailpeanut/ai-video-composer app
huggingface.co 的git下载让人火大,类似下面这样的 ``` git clone https://huggingface.co/spaces/cocktailpeanut/ai-video-composer app ```
sky22333 commented 2024-12-23 22:19:37 +08:00 (Migrated from github.com)

7d3a6d3b11/ghproxy/main.go (L25)

这里添加一下正则表达式应该就行

https://github.com/sky22333/hub-proxy/blob/7d3a6d3b11aa4ba65151403dc159b36e9952e228/ghproxy/main.go#L25 这里添加一下正则表达式应该就行
appotry commented 2024-12-23 22:44:34 +08:00 (Migrated from github.com)

@sky22333 这个是ai开发模型下载,应用最广泛的网站,ai界的github。这个网站一点都不小众,ai开发方面比github使用的更广泛

我自己试一下这个表达式,还是希望添加这个

@sky22333 这个是ai开发模型下载,应用最广泛的网站,ai界的github。这个网站一点都不小众,ai开发方面比github使用的更广泛 我自己试一下这个表达式,还是希望添加这个
sky22333 commented 2024-12-23 22:56:03 +08:00 (Migrated from github.com)

你试试增加这个正则表达式:

regexp.MustCompile(`^(?:https?://)?huggingface\.co/spaces/([^/]+)/([^/]+(?:\s[^/]+)?)$`)
你试试增加这个正则表达式: ``` regexp.MustCompile(`^(?:https?://)?huggingface\.co/spaces/([^/]+)/([^/]+(?:\s[^/]+)?)$`) ```
appotry commented 2024-12-23 23:29:47 +08:00 (Migrated from github.com)

还有lfs文件下载链接,类似下面这样

https://cdn-lfs.hf.co/repos/46/e1/46e16153e81dde129f27558fdc01c311a49ba0b9946efcff865bc5e9a6a3aac4/accfafccea92dbeb5cf99453576b2959efcbc26b67a89d9c39ac48bfe9cd82b5?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27waterfall.mp4%3B+filename%3D%22waterfall.mp4%22%3B&response-content-type=video%2Fmp4&Expires=1735224797&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTczNTIyNDc5N319LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy5oZi5jby9yZXBvcy80Ni9lMS80NmUxNjE1M2U4MWRkZTEyOWYyNzU1OGZkYzAxYzMxMWE0OWJhMGI5OTQ2ZWZjZmY4NjViYzVlOWE2YTNhYWM0L2FjY2ZhZmNjZWE5MmRiZWI1Y2Y5OTQ1MzU3NmIyOTU5ZWZjYmMyNmI2N2E4OWQ5YzM5YWM0OGJmZTljZDgyYjU%7EcmVzcG9uc2UtY29udGVudC1kaXNwb3NpdGlvbj0qJnJlc3BvbnNlLWNvbnRlbnQtdHlwZT0qIn1dfQ__&Signature=OUy74%7EL2txpAu0u%7E5YrtAeE4BvCg2jq%7EpkZwsU0AWb642oLUL%7EpX80XU20m--t1gr9l5jveBZJ0nRmRigpRTy0CcniIxBuGlHzJacoY7iN1UKw9r0y3-i81Uhd9sWgJDyH0Kou92jJdGex1JWYqfnl2oYWJKaLaH7vV-9-xbAjO4FK0MK7EuvsN4%7EMxPHJwmYUE3SKzNe2UdoAawzgGGxdKRFPlmzaraecCqfcM3ryPsREfPe11warImgAlivXUpTvLxjZfPIA63M1GBCwV3FYqWpyudMrwxgqlS9p1VPOk2GmRYulGT7cHGLV%7Er5fDGipC5LKpkV3ROtieTk%7ESVQw__&Key-Pair-Id=K3RPWS32NSSJCE

ai帮助写的下面这样的,这样可行么?我编译个镜像试试

	exps = []*regexp.Regexp{
		regexp.MustCompile(`^(?:https?://)?github\.com/([^/]+)/([^/]+)/(?:releases|archive)/.*$`),
		regexp.MustCompile(`^(?:https?://)?github\.com/([^/]+)/([^/]+)/(?:blob|raw)/.*$`),
		regexp.MustCompile(`^(?:https?://)?github\.com/([^/]+)/([^/]+)/(?:info|git-).*$`),
		regexp.MustCompile(`^(?:https?://)?raw\.github(?:usercontent|)\.com/([^/]+)/([^/]+)/.+?/.+$`),
		regexp.MustCompile(`^(?:https?://)?gist\.github(?:usercontent|)\.com/([^/]+)/.+?/.+`),
		regexp.MustCompile(`^(?:https?://)?api\.github\.com/repos/([^/]+)/([^/]+)/.*`),
		regexp.MustCompile(`^(?:https?://)?huggingface\.co/spaces/([^/]+)/([^/]+).*`),
		regexp.MustCompile(`^(?:https?://)?huggingface\.co/spaces/([^/]+)/([^/]+(?:\s[^/]+)?)$`),
		regexp.MustCompile(`^(?:https?://)?cdn-lfs\.hf\.co/repos/.+`),
	}
还有lfs文件下载链接,类似下面这样 ``` https://cdn-lfs.hf.co/repos/46/e1/46e16153e81dde129f27558fdc01c311a49ba0b9946efcff865bc5e9a6a3aac4/accfafccea92dbeb5cf99453576b2959efcbc26b67a89d9c39ac48bfe9cd82b5?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27waterfall.mp4%3B+filename%3D%22waterfall.mp4%22%3B&response-content-type=video%2Fmp4&Expires=1735224797&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTczNTIyNDc5N319LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy5oZi5jby9yZXBvcy80Ni9lMS80NmUxNjE1M2U4MWRkZTEyOWYyNzU1OGZkYzAxYzMxMWE0OWJhMGI5OTQ2ZWZjZmY4NjViYzVlOWE2YTNhYWM0L2FjY2ZhZmNjZWE5MmRiZWI1Y2Y5OTQ1MzU3NmIyOTU5ZWZjYmMyNmI2N2E4OWQ5YzM5YWM0OGJmZTljZDgyYjU%7EcmVzcG9uc2UtY29udGVudC1kaXNwb3NpdGlvbj0qJnJlc3BvbnNlLWNvbnRlbnQtdHlwZT0qIn1dfQ__&Signature=OUy74%7EL2txpAu0u%7E5YrtAeE4BvCg2jq%7EpkZwsU0AWb642oLUL%7EpX80XU20m--t1gr9l5jveBZJ0nRmRigpRTy0CcniIxBuGlHzJacoY7iN1UKw9r0y3-i81Uhd9sWgJDyH0Kou92jJdGex1JWYqfnl2oYWJKaLaH7vV-9-xbAjO4FK0MK7EuvsN4%7EMxPHJwmYUE3SKzNe2UdoAawzgGGxdKRFPlmzaraecCqfcM3ryPsREfPe11warImgAlivXUpTvLxjZfPIA63M1GBCwV3FYqWpyudMrwxgqlS9p1VPOk2GmRYulGT7cHGLV%7Er5fDGipC5LKpkV3ROtieTk%7ESVQw__&Key-Pair-Id=K3RPWS32NSSJCE ``` ai帮助写的下面这样的,这样可行么?我编译个镜像试试 ``` exps = []*regexp.Regexp{ regexp.MustCompile(`^(?:https?://)?github\.com/([^/]+)/([^/]+)/(?:releases|archive)/.*$`), regexp.MustCompile(`^(?:https?://)?github\.com/([^/]+)/([^/]+)/(?:blob|raw)/.*$`), regexp.MustCompile(`^(?:https?://)?github\.com/([^/]+)/([^/]+)/(?:info|git-).*$`), regexp.MustCompile(`^(?:https?://)?raw\.github(?:usercontent|)\.com/([^/]+)/([^/]+)/.+?/.+$`), regexp.MustCompile(`^(?:https?://)?gist\.github(?:usercontent|)\.com/([^/]+)/.+?/.+`), regexp.MustCompile(`^(?:https?://)?api\.github\.com/repos/([^/]+)/([^/]+)/.*`), regexp.MustCompile(`^(?:https?://)?huggingface\.co/spaces/([^/]+)/([^/]+).*`), regexp.MustCompile(`^(?:https?://)?huggingface\.co/spaces/([^/]+)/([^/]+(?:\s[^/]+)?)$`), regexp.MustCompile(`^(?:https?://)?cdn-lfs\.hf\.co/repos/.+`), } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: 3344/hubproxy#1