Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/chsrc-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ chsrc_register_chefs_and_sauciers ()
/**
* AI贡献者:
*
* ChatGPT、GitHub Copilot、DeepSeek、Claude
* ChatGPT、GitHub Copilot、DeepSeek、Claude、Qwen
*
* 这几位是贡献者显式说明的,也许还有隐式使用的一些AI并没有被记录下来,可以添加在这里
*/
Expand Down
2 changes: 2 additions & 0 deletions src/recipe/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
#include "ware/Flatpak.c"
#include "ware/Docker/Docker.c"
#include "ware/Anaconda/Anaconda.c"
#include "ware/Huggingface.c"


void
Expand Down Expand Up @@ -245,6 +246,7 @@ chsrc_init_menu ()
add (emacs);
add (tex);
add (anaconda);
add (huggingface_cli);
#undef add

chef_set_preparefn_for_sources_only_dish (pl_pypi);
Expand Down
63 changes: 63 additions & 0 deletions src/recipe/ware/Huggingface.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* ------------------------------------------------------------*/

def_dish(wr_huggingface_cli, "huggingface-cli/huggingface/hf");



void
wr_huggingface_cli_prepare ()
{
chef_prep_this_dish (wr_huggingface_cli, gsr);

chef_set_recipe_created_on (this, "2026-10-26");
chef_set_recipe_last_updated (this, "2026-10-28");

chef_set_chefs (this, 1, "@Mikachu2333");
chef_set_sauciers (this, 1, "@Mikachu2333");

chef_set_scope_cap (this, ProjectScope, ScopeCap_Unable);
chef_set_scope_cap (this, UserScope, ScopeCap_Able_And_Implemented);
chef_set_scope_cap (this, SystemScope, ScopeCap_Able_And_Implemented);
chef_set_default_scope (this, UserScope);

chef_deny_english(this);
chef_allow_user_define(this);

def_sources_begin()
{&UpstreamProvider, "https://huggingface.co", "https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash-1017/resolve/main/model.safetensors.index.json"}
def_sources_end()
}



void
wr_huggingface_cli_getsrc (char *option)
{
chsrc_view_env ("HF_ENDPOINT", NULL);
}



void
wr_huggingface_cli_setsrc (char *option)
{
char *repo_note = "请手动设置环境变量 HF_ENDPOINT 到您希望换源的站点,例如:\n";
char *site_note = "HF_ENDPOINT=\"https://huggingface.co\"\n";
char *end_note = "由于 Hugging Face 的体量极大,现有的镜像站点规模小、不保证运行及质量,因此不提供具体镜像站点,以上仅为示例。";


char *w = xy_strcat (3, repo_note, site_note, end_note);
say (w);

chsrc_determine_chgtype (ChgType_Manual);
chsrc_alert2 ("请重启终端使 HF_ENDPOINT 环境变量生效。");
}

void
wr_huggingface_cli_resetsrc (char *option)
{
char *w = "请手动删除环境变量 HF_ENDPOINT,并重启终端。\n";
say (w);
}