בדף הזה מפורטות הוראות להגדרה של שימוש ב-Gemma ב-Colab. חלק מ
הוראות רלוונטיות גם לסביבות פיתוח אחרות.
גישה ל-Gemma
לפני השימוש ב-Gemma בפעם הראשונה, צריך לבקש גישה אל
באמצעות Kaggle. כחלק מהתהליך, עליך להשתמש ב-Kaggle
לחשבון כדי לאשר את מדיניות השימוש ואת תנאי הרישיון של Gemma.
אם עדיין אין לך חשבון Kaggle, תוכל להירשם לחשבון כזה בכתובת
kaggle.com. לאחר מכן מבצעים את השלבים הבאים:
כדי להשתמש ב-Gemma, עליך לציין את שם המשתמש שלך ב-Kaggle ומפתח Kaggle API. שפת תרגום
כדי ליצור ולהגדיר את הערכים האלה, צריך לבצע את השלבים הבאים:
כדי ליצור מפתח Kaggle API, עוברים אל הכרטיסייה חשבון בחשבון של המשתמש ב-Kaggle.
פרופיל ובוחרים באפשרות יצירת אסימון חדש. פעולה זו תפעיל הורדה של
קובץ kaggle.json שמכיל את פרטי הכניסה שלך ל-API.
פתיחת kaggle.json בכלי לעריכת טקסט. התוכן אמור להיראות בערך כך
הזה:
ב-Colab, צריך לבחור באפשרות סודות (🔑) ולהוסיף את שם המשתמש שלך ב-Kaggle ואת Kaggle
מפתח API. שמירת שם המשתמש בשם KAGGLE_USERNAME וב-API
מתחת לשם KAGGLE_KEY.
עכשיו הכול מוכן להשלמת שלבי ההגדרה הנותרים ב-Colab. אם אתם
בעבודה על מדריך של Colab, צריך לעבור ל-Colab ולהגדיר את משתני הסביבה.
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2024-08-05 (שעון UTC)."],[],[],null,["# Gemma setup\n\nThis page provides setup instructions for using Gemma in Colab. Some of the\ninstructions are applicable to other development environments as well.\n\nGet access to Gemma\n-------------------\n\nBefore using Gemma for the first time, you must request access to the\nmodel through Kaggle. As part of the process, you'll have to use a Kaggle\naccount to accept the Gemma use policy and license terms.\n\nIf you don't already have a Kaggle account, you can register for one at\n[kaggle.com](https://www.kaggle.com). Then complete the following steps:\n\n1. Go to the [Gemma model card](https://www.kaggle.com/models/google/gemma) and select **Request Access**.\n2. Complete the consent form and accept the terms and conditions.\n\nSelect a Colab runtime\n----------------------\n\nTo complete a Colab tutorial, you must have a Colab runtime with sufficient\nresources to run the Gemma model. To [get started](./get_started), you can\nuse a T4 GPU:\n\n1. In the upper-right of the Colab window, select ▾ (**Additional connection options**).\n2. Select **Change runtime type**.\n3. Under **Hardware accelerator** , select **T4 GPU**.\n\nConfigure your API key\n----------------------\n\nTo use Gemma, you must provide your Kaggle username and a Kaggle API key. To\ngenerate and configure these values, follow these steps:\n\n1. To generate a Kaggle API key, go to the **Account** tab of your Kaggle [user\n profile](https://www.kaggle.com/settings) and select **Create New Token** . This will trigger the download of a `kaggle.json` file containing your API credentials.\n2. Open `kaggle.json` in a text editor. The contents should look something like\n this:\n\n {\"username\":\"your_username\",\"key\":\"012345678abcdef012345678abcdef1a\"}\n\n3. In Colab, select **Secrets** (🔑) and add your Kaggle username and Kaggle\n API key. Store your username under the name `KAGGLE_USERNAME` and your API\n key under the name `KAGGLE_KEY`.\n\n | **Note:** Kaggle notebooks have a key storage feature under **Add-ons** \\\u003e **Secrets**, along with instructions for accessing stored keys.\n\nNow you're ready to complete the remaining setup steps in Colab. If you're\nworking through a Colab tutorial, go to Colab and set the environment variables.\n| **Tip:** As an alternative to setting environment variables, you can use `kagglehub` to [authenticate](https://github.com/Kaggle/kagglehub?tab=readme-ov-file#authenticate)."]]