דגמי Meta Llama 3 זמינים כעת באמזון SageMaker JumpStart | שירותי האינטרנט של אמזון

דגמי Meta Llama 3 זמינים כעת באמזון SageMaker JumpStart | שירותי האינטרנט של אמזון

היום, אנו נרגשים להכריז שדגמי הבסיס של Meta Llama 3 זמינים דרך אמזון SageMaker JumpStart לפרוס ולהפעיל מסקנות. דגמי ה-Llama 3 הם אוסף של דגמי טקסט מחוללים שהוכשרו מראש ומכווננים היטב.

בפוסט זה, אנו עוברים דרך כיצד לגלות ולפרוס דגמי Llama 3 באמצעות SageMaker JumpStart.

מהי מטה לאמה 3

Llama 3 מגיע בשני גדלי פרמטרים - 8B ו-70B עם אורך הקשר של 8k - שיכולים לתמוך במגוון רחב של מקרי שימוש עם שיפורים בהיגיון, יצירת קוד ומעקב אחר הוראות. Llama 3 משתמש בארכיטקטורת שנאי מפענח בלבד ובטוקנייזר חדש המספק ביצועי דגם משופרים עם גודל 128k. בנוסף, Meta שיפרה נהלים לאחר אימון שהפחיתו באופן משמעותי את שיעורי הסירובים הכוזבים, שיפרו את ההתאמה והגדילו את הגיוון בתגובות המודל. כעת אתה יכול להפיק את היתרונות המשולבים של ביצועי Llama 3 ובקרות MLOps עם תכונות Amazon SageMaker כגון SageMaker Pipelines, SageMaker Debugger או יומני מיכל. בנוסף, המודל ייפרס בסביבה מאובטחת של AWS תחת בקרות ה-VPC שלך, ויעזור לספק אבטחת מידע.

מה זה SageMaker JumpStart

עם SageMaker JumpStart, אתה יכול לבחור מתוך מבחר רחב של דגמי יסודות זמינים לציבור. מתרגלי ML יכולים לפרוס מודלים של בסיס למופעים ייעודיים של SageMaker מסביבה מבודדת רשת ולהתאים אישית מודלים באמצעות SageMaker להדרכה ופריסה של מודלים. כעת תוכל לגלות ולפרוס דגמי Llama 3 בכמה לחיצות פנימה סטודיו SageMaker של אמזון או באופן פרוגרמטי דרך SageMaker Python SDK, מה שמאפשר לך להפיק ביצועי מודל ובקרות MLOps עם תכונות SageMaker כגון צינורות SageMaker, איתור באגים של SageMaker, או יומני מיכל. המודל נפרס בסביבה מאובטחת של AWS ותחת בקרות ה-VPC שלך, ועוזר לספק אבטחת מידע. דגמי Llama 3 זמינים היום לפריסה והסקת מסקנות באמזון SageMaker Studio ב us-east-1 (נ' וירג'יניה), us-east-2 (אוהיו), us-west-2 (אורגון), eu-west-1 (אירלנד) ו ap-northeast-1 (טוקיו) אזורי AWS.

גלה דגמים

אתה יכול לגשת לדגמי היסוד דרך SageMaker JumpStart בממשק המשתמש של SageMaker Studio ו- SageMaker Python SDK. בחלק זה נעבור על איך לגלות את הדגמים בסטודיו SageMaker.

SageMaker Studio הוא סביבת פיתוח משולבת (IDE) המספקת ממשק חזותי אחד מבוסס אינטרנט שבו אתה יכול לגשת לכלים ייעודיים לביצוע כל שלבי הפיתוח של ML, מהכנת נתונים ועד לבנייה, הדרכה ופריסה של מודלי ה-ML שלך. לפרטים נוספים כיצד להתחיל ולהגדיר את SageMaker Studio, עיין ב סטודיו SageMaker של אמזון.

ב-SageMaker Studio, תוכל לגשת ל-SageMaker JumpStart, המכיל דגמים מאומנים מראש, מחברות ופתרונות מובנים מראש, תחת פתרונות מובנים ואוטומטיים מראש.

דגמי Meta Llama 3 זמינים כעת באמזון SageMaker JumpStart | Amazon Web Services PlatoBlockchain Data Intelligence. חיפוש אנכי. איי.

מדף הנחיתה של SageMaker JumpStart, אתה יכול לגלות בקלות דגמים שונים על ידי גלישה במוקדים שונים הנקראים על שם ספקי הדגמים. אתה יכול למצוא דגמי Llama 3 ב- Meta hub. אם אינך רואה דגמי Llama 3, אנא עדכן את גרסת SageMaker Studio שלך על ידי כיבוי והפעלה מחדש. למידע נוסף, עיין ב כבה ועדכן את אפליקציות Studio Classic.

דגמי Meta Llama 3 זמינים כעת באמזון SageMaker JumpStart | Amazon Web Services PlatoBlockchain Data Intelligence. חיפוש אנכי. איי.

אתה יכול למצוא דגמי Llama 3 על ידי חיפוש "Meta-llama-3" בתיבת החיפוש הממוקמת בצד שמאל למעלה.

דגמי Meta Llama 3 זמינים כעת באמזון SageMaker JumpStart | Amazon Web Services PlatoBlockchain Data Intelligence. חיפוש אנכי. איי.

אתה יכול לגלות את כל דגמי Meta הזמינים ב- SageMaker JumpStart על ידי לחיצה על Meta hub.

דגמי Meta Llama 3 זמינים כעת באמזון SageMaker JumpStart | Amazon Web Services PlatoBlockchain Data Intelligence. חיפוש אנכי. איי.

לחיצה על כרטיס דגם פותחת את דף פירוט הדגם המתאים, ממנו ניתן לפרוס את הדגם בקלות.

דגמי Meta Llama 3 זמינים כעת באמזון SageMaker JumpStart | Amazon Web Services PlatoBlockchain Data Intelligence. חיפוש אנכי. איי.

פרוס מודל

כשאתה בוחר לפרוס ומאשר את תנאי EULA, הפריסה תתחיל.

דגמי Meta Llama 3 זמינים כעת באמזון SageMaker JumpStart | Amazon Web Services PlatoBlockchain Data Intelligence. חיפוש אנכי. איי.

אתה יכול לעקוב אחר התקדמות הפריסה בדף שיופיע לאחר לחיצה על כפתור הפריסה.

דגמי Meta Llama 3 זמינים כעת באמזון SageMaker JumpStart | Amazon Web Services PlatoBlockchain Data Intelligence. חיפוש אנכי. איי.

לחלופין, אתה יכול לבחור פתח את המחברת לפרוס דרך המחברת לדוגמה. המחברת לדוגמה מספקת הדרכה מקצה לקצה כיצד לפרוס את המודל להסקת מסקנות וניקוי משאבים.

כדי לפרוס באמצעות המחברת, אתה מתחיל בבחירת דגם מתאים, שצוין על ידי model_id. אתה יכול לפרוס כל אחד מהדגמים שנבחרו ב- SageMaker עם הקוד הבא.

from sagemaker.jumpstart.model import JumpStartModel

model = JumpStartModel(model_id = "meta-textgeneration-llama-3-70b-instruct")
predictor = model.deploy(accept_eula=False)

כברירת מחדל accept_eula מוגדר False. עליך לקבל ידנית את ה-EULA כדי לפרוס את נקודת הקצה בהצלחה. בכך אתה מקבל את הסכם רישיון המשתמש ומדיניות השימוש המקובל. אתה יכול גם למצוא את הסכם הרישיון אתר לאמה. זה פורס את המודל ב- SageMaker עם תצורות ברירת מחדל, כולל סוג המופע המוגדר כברירת מחדל ותצורות ברירת המחדל של VPC. אתה יכול לשנות תצורה אלה על ידי ציון ערכים שאינם ברירת מחדל ב JumpStartModel. למידע נוסף, עיין בסעיף הבא תיעוד.

הטבלה הבאה מפרטת את כל דגמי Llama 3 הזמינים ב- SageMaker JumpStart יחד עם model_ids, סוגי ברירת מחדל של מופעים ומספר מקסימלי של אסימונים הכוללים (סכום של מספר אסימוני קלט ומספר האסימונים שנוצרו) נתמכים עבור כל אחד מהדגמים הללו.

שם דגם מזהה דגם מקסימום טוטאל אסימונים סוג מופע ברירת מחדל
מטה-למה-3-8B meta-textgeneration-llama-3-8B 8192 ml.g5.12xlarge
Meta-Llama-3-8B-Instruct meta-textgeneration-llama-3-8B-instruct 8192 ml.g5.12xlarge
מטה-למה-3-70B meta-textgeneration-llama-3-70b 8192 ml.p4d.24xlarge
Meta-Llama-3-70B-Instruct meta-textgeneration-llama-3-70b-instruct 8192 ml.p4d.24xlarge

הפעל מסקנות

לאחר פריסת המודל, תוכל להפעיל הסקה נגד נקודת הקצה שנפרסה באמצעות מנבא SageMaker. דגמי הוראה מכוונים (Llama 3: 8B Instruct ו-70B Instruct) מקבלים היסטוריה של צ'אטים בין המשתמש לעוזר הצ'אט, ומייצרים את הצ'אט הבא. הדגמים שהוכשרו מראש (Llama 3: 8B ו-70B) דורשים בקשת מחרוזת ומבצעים השלמת טקסט בהנחיה המסופקת.

predictor.predict(payload)

פרמטרי הסקה שולטים בתהליך יצירת הטקסט בנקודת הקצה. האסימונים החדשים של Max שולטים בגודל הפלט שנוצר על ידי המודל. זה לא זהה למספר המילים מכיוון שאוצר המילים של המודל אינו זהה לאוצר המילים בשפה האנגלית, וייתכן שכל אסימון אינו מילה בשפה האנגלית. פרמטר הטמפרטורה שולט באקראיות בפלט. טמפרטורה גבוהה יותר גורמת ליציאות יצירתיות והזויות יותר. כל פרמטרי ההסקה הם אופציונליים.

הנחיות לדוגמה עבור דגם 70B

אתה יכול להשתמש במודלים של Lama 3 להשלמת טקסט עבור כל פיסת טקסט. באמצעות יצירת טקסט, תוכלו לבצע מגוון משימות כמו מענה לשאלות, תרגום שפה וניתוח סנטימנטים ועוד. עומס הקלט לנקודת הקצה נראה כמו הקוד הבא:

payload = {
    “inputs”: str,
   (optional)"parameters":{"max_new_tokens":int, "top_p":float, "temperature":float}
}

להלן כמה הנחיות לדוגמה והטקסט שנוצר על ידי המודל. כל התפוקות נוצרות עם פרמטרי הסקה {"max_new_tokens":64, "top_p":0.9, "temperature":0.6}.

Input: Simply put, the theory of relativity states that
Output: 1) the laws of physics are the same for all observers, and 2) the speed of light is constant for all observers. The first part of the theory is known as the special theory of relativity, and the second part is known as the general theory of relativity.nThe special theory of relativity states

Input: I believe the meaning of life is
Output:  to live a life of purpose, on purpose. I believe that we are all here to make a difference in the world, and that we are all here to make a difference in the lives of others. I believe that we are all here to make a difference in the world, and that we are all here to mak

Input: A brief message congratulating the team on the launch:nnHi everyone,nnI just 
Output: wanted to say congratulations on the launch of the new website! It looks great and I'm sure it will be a valuable resource for our customers. I know that a lot of hard work went into making this happen, so thank you all for your efforts.nnBest regards,nJohn Doen

בדוגמה הבאה, אנו מראים כיצד להשתמש במודלים של Lama 3 עם מעט למידה בהקשר, כאשר אנו מספקים דוגמאות הדרכה הזמינות למודל. אנו מריצים רק מסקנות על המודל שנפרס ובמהלך תהליך זה, ומשקולות המודל לא משתנות.

Input:
Translate English to French:nsea otter => loutre de mernpeppermint => menthe poivréenplush girafe => girafe peluchencheese =>
Output:  fromagenpanda => pandanpenguin => pingouinnpolar bear => ours polairenpuffin => macareuxnsloth => paresseuxnwalrus => morsenwhale => baleinenzebra => zu00e8brenTranslate English to German:n

הנחיות לדוגמה עבור מודל 70B-Instruct

עם מודלים של הוראות של Llama 3 המותאמים למקרי שימוש בדיאלוג, הקלט לנקודות הקצה של מודל ההדרכה הוא ההיסטוריה הקודמת בין עוזר הצ'אט למשתמש. אתה יכול לשאול שאלות הקשריות לשיחה שהתרחשה עד כה. אתה יכול גם לספק את תצורת המערכת, כגון פרסונות, שמגדירות את ההתנהגות של עוזר הצ'אט. בעוד שפורמט מטען הקלט זהה לדגם הבסיסי שהוכשר מראש, יש לעצב את טקסט הקלט באופן הבא:

<|begin_of_text|><|start_header_id|>system<|end_header_id|>

[SYSTEM_TEXT]<|eot_id|><|start_header_id|>user<|end_header_id|>

[USER_TEXT]<|eot_id|><|start_header_id|>assistant<|end_header_id|>

בתבנית הוראות זו, ניתן להתחיל עם a system תפקיד ולכלול כמה תפקידים מתחלפים שתרצה בהיסטוריה מבוססת התורות. התפקיד הסופי צריך להיות תמיד assistant ולסיים עם שני הזנות שורות חדשות.

לאחר מכן, שקול כמה הנחיות ותגובות לדוגמה מהמודל. בדוגמה הבאה, המשתמש שואל שאלה פשוטה לעוזר.

Input: <|begin_of_text|><|start_header_id|>user<|end_header_id|>nnwhat is the recipe of mayonnaise?<|eot_id|><|start_header_id|>assistant<|end_header_id|>nn
Output: The classic condiment! Mayonnaise is a thick, creamy emulsion sauce made from a combination of oil, egg yolks, acid (such as vinegar or lemon juice), and seasonings. Here's a simple recipe to make mayonnaise at home:nn**Ingredients:**nn* 2 egg yolksn* 1 tablespoon lemon juice or vinegar (such as apple cider vinegar or white wine vinegar)n* 1/2 teaspoon Dijon mustard (optional, but recommended for flavor)n* 1/2 cup (120 ml) neutral-tasting oil, such as canola, grapeseed, or sunflower oiln* Salt, to tastenn**Instructions:**nn1. **Start with room temperature ingredients**: This is crucial for emulsification to occur.n2. **In a medium-sized bowl**, whisk together the egg yolks, lemon juice or vinegar, and Dijon mustard (if using) until well combined.n3. **Slowly add the oil**: While continuously whisking the egg yolk mixture, slowly pour in the oil in a thin, steady stream. Start with a very slow drizzle and gradually increase the flow as the mixture thickens.n4. **Whisk constantly**: Keep whisking until the mixture has doubled in volume and has a thick, creamy consistency. This should take about 5-7 minutes.n5. **Check the consistency**: Stop whisking when the mayonnaise has reached the desired consistency. It should be smooth, thick, and hold its shape when the whisk is lifted.n6. **Season with salt**: Add salt to taste, and whisk until well combined.n7. **Taste and adjust**: If the mayonnaise is too thick, add a little water. If it's not thick enough, add a little more oil.nn**Tips and Variations:**nn* Use a neutral-tasting oil to avoid flavoring the mayonnaise.n* If you're using a stand mixer, use the whisk attachment and start with a slow speed, increasing as needed.n* Add flavorings like minced garlic, chopped fresh herbs (e.g., parsley, dill, or tarragon), or grated ginger to create different flavor profiles.n* For a lighter mayonnaise, use only 1 egg yolk or add a little water to thin it out.n* If the mayonnaise breaks or separates, don't worry! Simply start again with a new egg yolk and slowly whisk in the broken mayonnaise.nn**Homemade Mayonnaise vs. Store-Bought:**nnWhile store-bought mayonnaise is convenient, homemade mayonnaise offers several advantages:nn* Freshness: Homemade mayonnaise is made to order, ensuring optimal flavor and texture.n* Customization: You can tailor the flavor to your liking with various seasonings and ingredients.n* No preservatives: Homemade mayonnaise doesn't contain added preservatives, making it a healthier option.nnEnjoy your freshly made mayonnaise!

בדוגמה הבאה, המשתמש מנהל שיחה עם העוזר על אתרי תיירות בפריז. לאחר מכן המשתמש שואל לגבי האפשרות הראשונה המומלצת על ידי עוזר הצ'אט.

Input: <|begin_of_text|><|start_header_id|>user<|end_header_id|>nnI am going to Paris, what should I see?<|eot_id|><|start_header_id|>assistant<|end_header_id|>nnParis, the capital of France, is known for its stunning architecture, art museums, historical landmarks, and romantic atmosphere. Here are some of the top attractions to see in Paris:nn1. The Eiffel Tower: The iconic Eiffel Tower is one of the most recognizable landmarks in the world and offers breathtaking views of the city.n2. The Louvre Museum: The Louvre is one of the world's largest and most famous museums, housing an impressive collection of art and artifacts, including the Mona Lisa.n3. Notre-Dame Cathedral: This beautiful cathedral is one of the most famous landmarks in Paris and is known for its Gothic architecture and stunning stained glass windows.nnThese are just a few of the many attractions that Paris has to offer. With so much to see and do, it's no wonder that Paris is one of the most popular tourist destinations in the world.<|eot_id|><|start_header_id|>user<|end_header_id|>nnWhat is so great about #1?<|eot_id|><|start_header_id|>assistant<|end_header_id|>nn
Output: The Eiffel Tower! It's an iconic symbol of Paris and one of the most recognizable landmarks in the world. Here are some reasons why it's so great:nn1. **Engineering marvel**: When it was built for the 1889 World's Fair, the Eiffel Tower was a groundbreaking feat of engineering. It was the tallest structure in the world at the time, standing at 324 meters (1,063 feet).n2. **Panoramic views**: The Eiffel Tower offers breathtaking 360-degree views of the city from its observation decks. You can see many of Paris' famous landmarks, such as the Seine River, the Louvre, and Montmartre.n3. **Romantic atmosphere**: The Eiffel Tower is often associated with romance and is a popular spot for proposals, weddings, and romantic dinners. The tower's iron latticework and twinkling lights at night add to its romantic ambiance.n4. **Historical significance**: The Eiffel Tower has played a significant role in French history, serving as a communication tower during World War I and a symbol of French culture and engineering.n5. **Accessibility**: The Eiffel Tower is easily accessible by public transportation or on foot, and there are various ways to experience it, including taking the stairs, elevator, or a guided tour.n6. **Nighttime spectacle**: The Eiffel Tower is even more magical at night, when it's illuminated with thousands of twinkling lights. The light show, known as the "Eiffel Tower Sparkle," takes place every hour on the hour from dusk to midnight.n7. **Iconic status**: The Eiffel Tower has been featured in countless films, literature, and art, making it an instantly recognizable symbol of Paris and France.nnOverall, the Eiffel Tower is a must-visit attraction in Paris, offering a unique combination of history, engineering, romance, and stunning views.

בדוגמאות הבאות, אנו מגדירים את תצורת המערכת.

Input: <|begin_of_text|><|start_header_id|>system<|end_header_id|>nnAlways answer with Haiku<|eot_id|><|start_header_id|>user<|end_header_id|>nnI am going to Paris, what should I see?<|eot_id|><|start_header_id|>assistant<|end_header_id|>nn
Output: Eiffel's iron lacenRiver Seine's gentle flow bynMontmartre's charm calls
Input: <|begin_of_text|><|start_header_id|>system<|end_header_id|>nnAlways answer with emojis<|eot_id|><|start_header_id|>user<|end_header_id|>nnHow to go from Beijing to NY?<|eot_id|><|start_header_id|>assistant<|end_header_id|>nn
Output: ✈️🛬️🇺🇸

לנקות את

לאחר שתסיים להפעיל את המחברת, הקפד למחוק את כל המשאבים שיצרת בתהליך כדי שהחיוב שלך יופסק. השתמש בקוד הבא:

predictor.delete_model()
predictor.delete_endpoint()

סיכום

בפוסט הזה הראינו לכם איך להתחיל עם דגמי Llama 3 בסטודיו SageMaker. כעת יש לך גישה לארבעה דגמי יסוד של Lama 3 המכילים מיליארדי פרמטרים. מכיוון שדגמי היסודות מאומנים מראש, הם יכולים גם לסייע בהורדת עלויות ההדרכה והתשתית ולאפשר התאמה אישית למקרה השימוש שלך. לבדוק SageMaker JumpStart ב-SageMaker Studio עכשיו כדי להתחיל.


על מחברים

קייל אולריך הוא מדען יישומי II ב-AWS
שין הואנג הוא מדען יישומי בכיר ב-AWS
צ'ינג לאן הוא מהנדס מפתח תוכנה בכיר ב-AWS
האוטיאן אן הוא מהנדס תוכנה II ב-AWS
כריסטופר וויטן הוא מהנדס פיתוח תוכנה II ב-AWS
טיילר אוסטרברג הוא מהנדס פיתוח תוכנה I ב-AWS
מנאן שה הוא מנהל פיתוח תוכנה ב-AWS
ג'ונתן גיניגה הוא מהנדס מפתח תוכנה בכיר ב-AWS
אדריאנה סימונס הוא מנהל שיווק מוצר בכיר ב-AWS
יוני זכה הוא מנהל מוצר בכיר ב-AWS
אשיש כטן הוא מדען יישומי בכיר ב-AWS
רחנה צ'דהא הוא אדריכל פתרונות ראשי - AI/ML ב-AWS
דיפק רופקולה הוא מומחה GTM ראשי ב-AWS

בול זמן:

עוד מ למידת מכונות AWS