ذكاء بيانات أفلاطون.
البحث العمودي و Ai.

يتوفر Databricks DBRX الآن في Amazon SageMaker JumpStart | خدمات الويب الأمازون

التاريخ:

واليوم، يسعدنا أن نعلن أن نموذج دي بي آر إكس، نموذج لغة كبير مفتوح للأغراض العامة (LLM) تم تطويره بواسطة Databricks، متاح للعملاء من خلال أمازون سيج ميكر جومب ستارت للنشر بنقرة واحدة لتشغيل الاستدلال. تستخدم DBRX LLM بنية مزيج دقيق من الخبراء (MoE)، تم تدريبها مسبقًا على 12 تريليون رمز من البيانات المنسقة بعناية وطول سياق أقصى يبلغ 32,000 رمز.

يمكنك تجربة هذا النموذج باستخدام SageMaker JumpStart، وهو مركز التعلم الآلي (ML) الذي يوفر الوصول إلى الخوارزميات والنماذج حتى تتمكن من بدء استخدام تعلم الآلة بسرعة. في هذا المنشور، نتعرف على كيفية اكتشاف نموذج DBRX ونشره.

ما هو نموذج DBRX

DBRX عبارة عن LLM متطور لوحدة فك التشفير فقط مبني على بنية المحولات. وهي تستخدم بنية وزارة التربية الدقيقة، التي تتضمن 132 مليار معلمة إجمالية، مع 36 مليار من هذه المعلمات النشطة لأي مدخلات معينة.

خضع النموذج لتدريب مسبق باستخدام مجموعة بيانات تتكون من 12 تريليون رمز نصي وتعليمي برمجي. وعلى النقيض من نماذج وزارة التربية المفتوحة الأخرى مثل Mixtral وGrok-1، يتميز DBRX بنهج دقيق، باستخدام كمية أكبر من الخبراء الأصغر للحصول على أداء أمثل. بالمقارنة مع نماذج وزارة التعليم الأخرى، لدى DBRX 16 خبيرًا وتختار 4.

النموذج متاح بموجب ترخيص Databricks Open Model للاستخدام دون قيود.

ما هو برنامج SageMaker JumpStart

SageMaker JumpStart عبارة عن منصة مُدارة بالكامل توفر نماذج أساسية حديثة لحالات الاستخدام المختلفة مثل كتابة المحتوى وإنشاء التعليمات البرمجية والإجابة على الأسئلة وكتابة النصوص والتلخيص والتصنيف واسترجاع المعلومات. فهو يوفر مجموعة من النماذج المدربة مسبقًا والتي يمكنك نشرها بسرعة وسهولة، مما يؤدي إلى تسريع عملية تطوير ونشر تطبيقات تعلم الآلة. أحد المكونات الرئيسية لـ SageMaker JumpStart هو Model Hub، الذي يقدم كتالوجًا كبيرًا من النماذج المدربة مسبقًا، مثل DBRX، لمجموعة متنوعة من المهام.

يمكنك الآن اكتشاف نماذج DBRX ونشرها ببضع نقرات أمازون ساجميكر ستوديو أو برمجيًا من خلال SageMaker Python SDK، مما يتيح لك استخلاص أداء النموذج وعناصر تحكم MLOps باستخدام الأمازون SageMaker ميزات مثل خطوط أنابيب Amazon SageMaker, الأمازون SageMaker المصححأو سجلات الحاوية. يتم نشر النموذج في بيئة AWS الآمنة وتحت ضوابط VPC الخاصة بك، مما يساعد على توفير أمان البيانات.

اكتشف النماذج في SageMaker JumpStart

يمكنك الوصول إلى نموذج DBRX من خلال SageMaker JumpStart في SageMaker Studio UI وSageMaker Python SDK. في هذا القسم، سنتعرف على كيفية اكتشاف النماذج في SageMaker Studio.

SageMaker Studio عبارة عن بيئة تطوير متكاملة (IDE) توفر واجهة مرئية واحدة قائمة على الويب حيث يمكنك الوصول إلى الأدوات المصممة لغرض تنفيذ جميع خطوات تطوير ML ، من إعداد البيانات إلى البناء والتدريب ونشر نماذج ML الخاصة بك. لمزيد من التفاصيل حول كيفية البدء وإعداد SageMaker Studio ، يرجى الرجوع إلى أمازون ساجميكر ستوديو.

في SageMaker Studio، يمكنك الوصول إلى SageMaker JumpStart عن طريق الاختيار بداية القفز في جزء التنقل.

من الصفحة المقصودة لـ SageMaker JumpStart، يمكنك البحث عن "DBRX" في مربع البحث. سوف تظهر نتائج البحث تعليمات DBRX و قاعدة دي بي آر إكس.

يمكنك اختيار بطاقة النموذج لعرض تفاصيل حول النموذج مثل الترخيص والبيانات المستخدمة للتدريب وكيفية استخدام النموذج. سوف تجد أيضا نشر زر لنشر النموذج وإنشاء نقطة نهاية.

انشر النموذج في SageMaker JumpStart

يبدأ النشر عندما تختار نشر زر. بعد انتهاء النشر، سترى أنه تم إنشاء نقطة النهاية. يمكنك اختبار نقطة النهاية عن طريق تمرير نموذج حمولة طلب الاستدلال أو عن طريق تحديد خيار الاختبار باستخدام SDK. عندما تحدد خيار استخدام SDK، سترى رمز المثال الذي يمكنك استخدامه في محرر دفتر الملاحظات الذي تختاره في SageMaker Studio.

قاعدة دي بي آر إكس

للنشر باستخدام SDK، نبدأ بتحديد نموذج DBRX Base، المحدد بواسطة model_id مع قيمة تعانق الوجه-llm-dbrx-base. يمكنك نشر أي من النماذج المحددة على SageMaker باستخدام الكود التالي. وبالمثل، يمكنك نشر DBRX Instruct باستخدام معرف النموذج الخاص به.

from sagemaker.jumpstart.model import JumpStartModel

accept_eula = True

model = JumpStartModel(model_id="huggingface-llm-dbrx-base")
predictor = model.deploy(accept_eula=accept_eula)

يؤدي هذا إلى نشر النموذج على SageMaker بالتكوينات الافتراضية، بما في ذلك نوع المثيل الافتراضي وتكوينات VPC الافتراضية. يمكنك تغيير هذه التكوينات عن طريق تحديد قيم غير افتراضية في نموذج JumpStart. يجب تعريف قيمة Eula بشكل صريح على أنها True لقبول اتفاقية ترخيص المستخدم النهائي (EULA). تأكد أيضًا من أن لديك حد الخدمة على مستوى الحساب لاستخدام ml.p4d.24xlarge أو ml.pde.24xlarge لاستخدام نقطة النهاية كمثيل واحد أو أكثر. يمكنك اتباع التعليمات هنا من أجل طلب زيادة حصة الخدمة.

بعد نشره، يمكنك تشغيل الاستدلال على نقطة النهاية المنشورة من خلال أداة توقع SageMaker:

payload = {
    "inputs": "Hello!",
    "parameters": {
        "max_new_tokens": 10,
    },
}
predictor.predict(payload)

يطالب سبيل المثال

يمكنك التفاعل مع نموذج DBRX Base مثل أي نموذج قياسي لإنشاء النص، حيث يقوم النموذج بمعالجة تسلسل الإدخال والمخرجات المتوقعة بالكلمات التالية في التسلسل. في هذا القسم، نقدم بعض الأمثلة للمطالبات وعينات الإخراج.

رمز الجيل

باستخدام المثال السابق، يمكننا استخدام مطالبات إنشاء التعليمات البرمجية على النحو التالي:

payload = { 
      "inputs": "Write a function to read a CSV file in Python using pandas library:", 
      "parameters": { 
          "max_new_tokens": 30, }, } 
           response = predictor.predict(payload)["generated_text"].strip() 
           print(response)

وفيما يلي الإخراج:

import pandas as pd 
df = pd.read_csv("file_name.csv") 
#The above code will import pandas library and then read the CSV file using read_csv

تحليل المشاعر

يمكنك إجراء تحليل المشاعر باستخدام موجه مثل ما يلي مع DBRX:

payload = {
"inputs": """
Tweet: "I am so excited for the weekend!"
Sentiment: Positive

Tweet: "Why does traffic have to be so terrible?"
Sentiment: Negative

Tweet: "Just saw a great movie, would recommend it."
Sentiment: Positive

Tweet: "According to the weather report, it will be cloudy today."
Sentiment: Neutral

Tweet: "This restaurant is absolutely terrible."
Sentiment: Negative

Tweet: "I love spending time with my family."
Sentiment:""",
"parameters": {
"max_new_tokens": 2,
},
}
response = predictor.predict(payload)["generated_text"].strip()
print(response)

وفيما يلي الإخراج:

الإجابة على السؤال

يمكنك استخدام موجه الإجابة على الأسئلة كما يلي مع DBRX:

# Question answering
payload = {
    "inputs": "Respond to the question: How did the development of transportation systems, such as railroads and steamships, impact global trade and cultural exchange?",
    "parameters": {
        "max_new_tokens": 225,
    },
}
response = predictor.predict(payload)["generated_text"].strip()
print(response)

وفيما يلي الإخراج:

The development of transportation systems, such as railroads and steamships, impacted global trade and cultural exchange in a number of ways. 
The documents provided show that the development of these systems had a profound effect on the way people and goods were able to move around the world. 
One of the most significant impacts of the development of transportation systems was the way it facilitated global trade. 
The documents show that the development of railroads and steamships made it possible for goods to be transported more quickly and efficiently than ever before. 
This allowed for a greater exchange of goods between different parts of the world, which in turn led to a greater exchange of ideas and cultures. 
Another impact of the development of transportation systems was the way it facilitated cultural exchange. The documents show that the development of railroads and steamships made it possible for people to travel more easily and quickly than ever before. 
This allowed for a greater exchange of ideas and cultures between different parts of the world. Overall, the development of transportation systems, such as railroads and steamships, had a profound impact on global trade and cultural exchange.

تعليمات DBRX

يقبل الإصدار المضبوط للتعليمات من DBRX الإرشادات المنسقة حيث يجب أن تبدأ أدوار المحادثة بمطالبة من المستخدم وتتناوب بين تعليمات المستخدم والمساعد (DBRX-instruct). يجب احترام تنسيق التعليمات بشكل صارم، وإلا فإن النموذج سيولد مخرجات دون المستوى الأمثل. يتم تعريف القالب لإنشاء موجه لنموذج Instruct على النحو التالي:

<|im_start|>system
{system_message} <|im_end|>
<|im_start|>user
{human_message} <|im_end|>
<|im_start|>assistantn

<|im_start|> و <|im_end|> هي رموز خاصة لبداية السلسلة (BOS) ونهاية السلسلة (EOS). يمكن أن يحتوي النموذج على العديد من المحادثات بين النظام والمستخدم والمساعد، مما يسمح بدمج أمثلة قليلة لتعزيز استجابات النموذج.

يوضح التعليمة البرمجية التالية كيف يمكنك تنسيق المطالبة بتنسيق التعليمات:

from typing import Dict, List

def format_instructions(instructions: List[Dict[str, str]]) -> List[str]:
    """Format instructions where conversation roles must alternate system/user/assistant/user/assistant/..."""
    prompt: List[str] = []
    for instruction in instructions:
        if instruction["role"] == "system":
            prompt.extend(["<|im_start|>systemn", (instruction["content"]).strip(), " <|im_end|>n"])
        elif instruction["role"] == "user":
            prompt.extend(["<|im_start|>usern", (instruction["content"]).strip(), " <|im_end|>n"])
        else:
            raise ValueError(f"Invalid role: {instruction['role']}. Role must be either 'user' or 'system'.")
    prompt.extend(["<|im_start|>assistantn"])
    return "".join(prompt)

def print_instructions(prompt: str, response: str) -> None:
    bold, unbold = '33[1m', '33[0m'
    print(f"{bold}> Input{unbold}n{prompt}nn{bold}> Output{unbold}n{response['generated_text'].strip()}n")

استرجاع المعرفة

يمكنك استخدام الموجه التالي لاسترجاع المعرفة:

instructions = [
{"role": "system", "content": "You are an expert in suggesting diet plans optimized for different sports or fitness activities, taking into account energy requirements, and recovery requirements."},
{"role": "user", "content": "I am trying to build muscle mass and increase my strength. What kind of high-protein, calorie-dense diet plan would you recommend for me?"}
]
prompt = format_instructions(instructions)
payload = {
"inputs": prompt,
"parameters": {"max_new_tokens": 700, "temperature": 0.5, "do_sample": True}
}
response=predictor.predict(payload)
print_instructions(prompt, response)

وفيما يلي الإخراج:

> Input
<|im_start|>system
You are an expert in suggesting diet plans optimized for different sports or fitness activities, taking into account energy requirements, and recovery requirements. <|im_end|>
<|im_start|>user
I am trying to build muscle mass and increase my strength. What kind of high-protein, calorie-dense diet plan would you recommend for me? <|im_end|>
<|im_start|>assistant

> Output
Absolutely, I'd be happy to help you with that. Given your goal of building muscle mass and increasing strength, you'll want a diet that's high in protein and provides sufficient calories to support muscle growth and recovery. Here's a basic outline of what your diet plan could look like:

1. **Breakfast:**
   - 3 whole eggs
   - 3 egg whites
   - 1 cup of oatmeal
   - 1 scoop of whey protein
   - 1 banana

2. **Mid-Morning Snack:**
   - 1.5 ounces of almonds
   - 1 apple

3. **Lunch:**
   - 8 ounces of chicken breast
   - 1 cup of brown rice
   - 1 cup of mixed vegetables

4. **Afternoon Snack:**
   - 1.5 cups of Greek yogurt
   - 1 cup of mixed berries

5. **Dinner:**
   - 8 ounces of salmon or lean beef
   - 1 cup of quinoa
   - 1.5 cups of mixed vegetables

6. **Evening Snack:**
   - 1 scoop of casein protein
   - 1 tablespoon of almond butter

This is a high-protein, calorie-dense diet that includes a variety of nutrient-rich foods. It's important to note that everyone's nutritional needs are different, so you may need to adjust portion sizes or food choices based on your specific needs and preferences.

Also, remember to stay hydrated by drinking plenty of water throughout the day. Regular exercise, particularly strength training, is crucial to achieving your goals. It's also important to get enough sleep to aid in muscle recovery and growth.

Before starting any new diet or exercise program, it's a good idea to consult with a healthcare professional or a registered dietitian. They can provide personalized advice based on your health history and current lifestyle.

رمز الجيل

تُظهر نماذج DBRX نقاط القوة المعيارية لمهام الترميز. على سبيل المثال، راجع الكود التالي:

instructions = [ 
{"role": "system", "content": "You are an expert in coding and programming. Your role is to provide examples, explanations, and insights related to programming languages, algorithms, data structures, and software development practices."}, 
{"role": "user", "content": "Write a Python script to read a CSV file containing stock prices and plot the closing prices over time using Matplotlib."} 
] 
prompt = format_instructions(instructions) 
payload = { "inputs": prompt, "parameters": {"max_new_tokens": 315, "temperature": 0.3, "do_sample": True} } 
response=predictor.predict(payload) 
print_instructions(prompt, response)

وفيما يلي الإخراج:

> Input
<|im_start|>system
You are an expert in coding and programming. Your role is to provide examples, explanations, and insights related to programming languages, algorithms, data structures, and software development practices. <|im_end|>
<|im_start|>user
Write a Python script to read a CSV file containing stock prices and plot the closing prices over time using Matplotlib. <|im_end|>
<|im_start|>assistant

> Output
Sure, I'd be happy to help you with that. Here's a simple Python script that uses the `pandas` library to read a CSV file and `matplotlib` to plot the closing prices over time.

```python
import pandas as pd
import matplotlib.pyplot as plt

# Load the data from a CSV file
df = pd.read_csv('stock_prices.csv')

# Plot the closing prices over time
plt.figure(figsize=(12,5))
plt.plot(df['Date'], df['Close'])
plt.xlabel('Date')
plt.ylabel('Price')
plt.title('Stock Prices Over Time')
plt.show()
```

In this script, replace `'stock_prices.csv'` with the path to your CSV file. The file should have columns named 'Date' and 'Close' for this script to work correctly. If your file uses different column names, you'll need to adjust the script accordingly.

The `pandas` library is a powerful tool for data manipulation and analysis. It can read data from a variety of sources, including CSV files, and represent the data in a tabular format. The `matplotlib` library is a popular choice for creating static, animated, and interactive visualizations in Python.

This script first loads the data from the CSV file into a pandas DataFrame. It then plots the 'Close' column against the 'Date' column using matplotlib's `plot()` function. The `figure()` function is used to specify the size of the plot, and `show()` is used to display the plot.

الرياضيات والتفكير

تُبلغ نماذج DBRX أيضًا عن نقاط القوة في الدقة الرياضية. على سبيل المثال، راجع الكود التالي:

instructions = [
  {"role": "system", "content": "You are an expert in mathematics and reasoning. Your role is to provide examples, explanations, and insights related to mathematical concepts, problem-solving techniques, and logical reasoning."},
  {"role": "user", "content": "A car rental company charges $40 per day plus $0.25 per mile driven. If I rented a car for 3 days and drove 250 miles, what would be the total cost? Break down the calculation steps before giving the final answer."}
]
prompt = format_instructions(instructions)
payload = {
"inputs": prompt,
"parameters": {"max_new_tokens": 400, "temperature": 0.2, "do_sample": True}
}
response=predictor.predict(payload)
print_instructions(prompt, response)

يمكن أن يوفر DBRX الفهم كما هو موضح في الإخراج التالي باستخدام المنطق الرياضي:

> Input
<|im_start|>system
You are an expert in mathematics and reasoning. Your role is to provide examples, explanations, and insights related to mathematical concepts, problem-solving techniques, and logical reasoning. <|im_end|>
<|im_start|>user
A car rental company charges $40 per day plus $0.25 per mile driven. If I rented a car for 3 days and drove 250 miles, what would be the total cost? Break down the calculation steps before giving the final answer. <|im_end|>
<|im_start|>assistant

> Output
Sure, I'd be happy to help with that! The problem you've presented involves both fixed costs (the daily rate) and variable costs (the cost per mile). Let's break it down:

1. First, let's calculate the total cost of the fixed daily rate. The car rental company charges $40 per day, and you rented the car for 3 days. So, the total cost for the daily rate is $40/day * 3 days = $120.

2. Next, let's calculate the total cost of the variable rate, which is the cost per mile driven. The company charges $0.25 per mile, and you drove 250 miles. So, the total cost for the mileage is $0.25/mile * 250 miles = $62.50.

3. Finally, to find the total cost of renting the car, we add the total cost of the daily rate and the total cost of the mileage. So, the total cost is $120 + $62.50 = $182.50.

So, the total cost of renting the car for 3 days and driving 250 miles would be $182.50.

تنظيف

بعد الانتهاء من تشغيل دفتر الملاحظات، تأكد من حذف كافة الموارد التي قمت بإنشائها في العملية حتى يتم إيقاف الفوترة. استخدم الكود التالي:

predictor.delete_model()
predictor.delete_endpoint()

وفي الختام

في هذا المنشور، أوضحنا لك كيفية البدء باستخدام DBRX في SageMaker Studio ونشر النموذج للاستدلال. نظرًا لأن النماذج الأساسية تم تدريبها مسبقًا، فيمكنها المساعدة في تقليل تكاليف التدريب والبنية التحتية وتمكين التخصيص لحالة الاستخدام الخاصة بك. تفضل بزيارة SageMaker JumpStart في SageMaker Studio الآن للبدء.

الموارد


حول المؤلف

شيخار كواترة هو مهندس حلول متخصص في الذكاء الاصطناعي/تعلم الآلة في Amazon Web Services، ويعمل مع أحد الشركات العالمية الرائدة في مجال تكامل الأنظمة. وقد حصل على لقب أحد أصغر المخترعين الهنود مع أكثر من 400 براءة اختراع في مجالات الذكاء الاصطناعي/التعلم الآلي وإنترنت الأشياء. يتمتع بأكثر من 8 سنوات من الخبرة الصناعية بدءًا من الشركات الناشئة وحتى المؤسسات واسعة النطاق، بدءًا من مهندس أبحاث إنترنت الأشياء، وعالم البيانات، ومهندس البيانات والذكاء الاصطناعي. يساعد شيخار في تصميم وبناء وصيانة بيئات سحابية فعالة من حيث التكلفة وقابلة للتطوير للمؤسسات ويدعم شركاء GSI في بناء الصناعة الإستراتيجية

نيثين فيجياسواران هو مهندس الحلول في AWS. مجال تركيزه هو الذكاء الاصطناعي التوليدي ومسرعات AWS AI. وهو حاصل على درجة البكالوريوس في علوم الكمبيوتر والمعلوماتية الحيوية. تعمل Niithiyn بشكل وثيق مع فريق Geneative AI GTM لتمكين عملاء AWS على جبهات متعددة وتسريع اعتمادهم للذكاء الاصطناعي التوليدي. إنه من أشد المعجبين بفريق دالاس مافريكس ويستمتع بجمع الأحذية الرياضية.

سيباستيان بوستيلو هو مهندس الحلول في AWS. إنه يركز على تقنيات الذكاء الاصطناعي/التعلم الآلي مع شغف عميق بالذكاء الاصطناعي التوليدي ومسرعات الحوسبة. في AWS، يساعد العملاء على إطلاق العنان لقيمة الأعمال من خلال الذكاء الاصطناعي التوليدي. عندما لا يكون في العمل، يستمتع بتحضير كوب مثالي من القهوة المتخصصة واستكشاف العالم مع زوجته.

أرماندو دياز هو مهندس الحلول في AWS. وهو يركز على الذكاء الاصطناعي التوليدي والذكاء الاصطناعي/تعلم الآلة وتحليلات البيانات. في AWS، يساعد Armando العملاء على دمج قدرات الذكاء الاصطناعي التوليدية المتطورة في أنظمتهم، وتعزيز الابتكار والميزة التنافسية. عندما لا يكون في العمل، يستمتع بقضاء الوقت مع زوجته وعائلته، والمشي لمسافات طويلة، والسفر حول العالم.

بقعة_صورة

أحدث المعلومات الاستخباراتية

بقعة_صورة

الدردشة معنا

أهلاً! كيف يمكنني مساعدك؟