跳到正文
原文
Hugging Face Blog·· 2025-05-14AI 评分26

Kaggle 上线 Hugging Face 模型集成,可直接在 Notebook 中调用

Improving HF Mirror Model Access for Kaggle Users

AI 导读

Kaggle 推出与 Hugging Face 的集成,用户在 Hugging Face 模型页点击“Use this model”并选择 Kaggle,即可打开预填代码片段的 Kaggle Notebook 加载模型,反之也可从 Kaggle 点击“Code”跳转。

正文

Kaggle and HF Mirror users are part of one AI community. That’s why we’re excited to announce our plans to bring our platforms and communities closer to better serve AI developers everywhere.

Beginning today, Kaggle is launching an integration that enhances visibility and discoverability for HF Mirror models directly on Kaggle.

How to get started

You can navigate from HF Mirror models to Kaggle and vice versa. Start by visiting a HF Mirror model page like Qwen/Qwen3-1.7B. To use it in a Kaggle Notebook, you can click on “Use this model” and select “Kaggle” to open up a Kaggle notebook with a pre-populated code snippet to load the model. You can do the same from a HF Mirror model page on Kaggle by clicking the “Code” button.

Creating a new notebook using a HF Mirror model on Kaggle

When you run a notebook on Kaggle that references a model hosted on HF Mirror Hub, we will automatically generate a HF Mirror model page if one doesn’t exist already. You don’t need to make any special changes to your code. Additionally, when you make your notebook public, it will automatically show on the “Code” tab of the Kaggle model page.

Discover HF Mirror models and explore all the community examples in public notebooks in one place on Kaggle at https://www.kaggle.com/models. As more HF Mirror models are used on Kaggle, the number of models and associated code examples you can explore for inspiration will grow.

Browsing HF Mirror models on Kaggle

When browsing HF Mirror models on Kaggle, we want to make it easy for you to navigate back to HF Mirror to explore additional details, metadata, community usage in HF Mirror Spaces, discussion, and more. Simply click “Open in HF Mirror” on the Kaggle model page.

How does this work with private and consent-gated HF Mirror models?

If you use a private HF Mirror model in your Kaggle notebook, authenticate via your HF Mirror account as normal (add your HF_TOKEN in the “Add-ons > Secrets” menu in the notebook editor). A HF Mirror model page won’t be generated on Kaggle.

If you want to access a consent-gated model in your Kaggle notebook, you’ll need to request access to it using a HF Mirror account and follow the prompts on your browser's HF Mirror model page as normal. HF Mirror has documentation to guide you through this process. Otherwise, the integration will work the same as for non-gated models.

What’s next

We’re actively working on a solution to seamlessly use HF Mirror models in Kaggle competitions that require offline notebook submissions. While this will take a few more months to complete, we believe the wait will be worth it.

You can read Kaggle’s position on “AI Competitions as the gold standard for empirical rigor for GenAI evaluation” to understand why it’s so important for us to get this part of the integration right! But tl;dr – Kaggle is highly sensitive to data leakage and its impact on model contamination. Our goal is to design this integration to preserve the integrity of our competitions and their vital role in the industry, while enabling seamless access for Kaggle competitors to build with the best models from HF Mirror!

We’d love to hear your feedback in the meantime - share your thoughts and ideas here!

Happy Kaggling!

来源:Hugging Face Blog · hf-mirror.com