Logo Zephyrnet

Databricks DBRX wa bayi ni Amazon SageMaker JumpStart | Amazon Web Services

ọjọ:

Loni, a ni inudidun lati kede pe awọn DBRX awoṣe, Ṣiṣii, awoṣe gbogbogbo-idi nla ede (LLM) ni idagbasoke nipasẹ Awọn iwe data, wa fun awọn onibara nipasẹ Amazon SageMaker JumpStart lati ran awọn pẹlu ọkan tẹ fun ṣiṣe inference. DBRX LLM n gba iṣẹ-itumọ idapọ-ti awọn amoye (MoE), ti a ti kọ tẹlẹ lori awọn ami ami 12 aimọye ti data ti a ti farabalẹ ati ipari ipo ipo ti o pọju ti awọn ami ami 32,000.

O le gbiyanju awoṣe yii pẹlu SageMaker JumpStart, ibudo ẹkọ ẹrọ (ML) ti o pese iraye si awọn algoridimu ati awọn awoṣe ki o le yara bẹrẹ pẹlu ML. Ninu ifiweranṣẹ yii, a rin nipasẹ bii o ṣe le ṣawari ati mu awoṣe DBRX ṣiṣẹ.

Kini awoṣe DBRX

DBRX jẹ LLM decoder ti o fafa ti a ṣe lori faaji ẹrọ iyipada. O nlo iṣẹ-itumọ MoE ti o dara, ti o ṣafikun 132 bilionu lapapọ awọn paramita, pẹlu 36 bilionu ti awọn paramita wọnyi ti n ṣiṣẹ fun titẹ sii eyikeyi.

Awoṣe naa ṣe ikẹkọ iṣaaju-iṣaaju nipa lilo dataset ti o ni awọn ami-ami 12 aimọye ti ọrọ ati koodu. Ni idakeji si awọn awoṣe MoE miiran ti o ṣii bi Mixtral ati Grok-1, DBRX ṣe ẹya ọna ti o dara, ni lilo iwọn ti o ga julọ ti awọn amoye kekere fun iṣẹ iṣapeye. Ni afiwe si awọn awoṣe MoE miiran, DBRX ni awọn amoye 16 o yan 4.

Awoṣe naa wa labẹ iwe-aṣẹ Awoṣe Ṣii Databricks, fun lilo laisi awọn ihamọ.

Kini SageMaker JumpStart

SageMaker JumpStart jẹ ipilẹ ti iṣakoso ni kikun ti o funni ni awọn awoṣe ipilẹ-ti-ti-aworan fun ọpọlọpọ awọn ọran lilo gẹgẹbi kikọ akoonu, iran koodu, idahun ibeere, ẹda ẹda, akopọ, ipinya, ati igbapada alaye. O pese akojọpọ awọn awoṣe ti a ti kọkọ tẹlẹ ti o le fi ranṣẹ ni iyara ati pẹlu irọrun, iyara idagbasoke ati imuṣiṣẹ ti awọn ohun elo ML. Ọkan ninu awọn paati bọtini ti SageMaker JumpStart jẹ Ipele Awoṣe, eyiti o funni ni katalogi ti o tobi pupọ ti awọn awoṣe ti a ti kọkọ tẹlẹ, bii DBRX, fun ọpọlọpọ awọn iṣẹ ṣiṣe.

O le ṣe iwari ati mu awọn awoṣe DBRX ṣiṣẹ pẹlu awọn titẹ diẹ sii Amazon SageMaker Studio tabi ni eto nipasẹ SageMaker Python SDK, n jẹ ki o ni anfani iṣẹ awoṣe ati awọn iṣakoso MLOps pẹlu Ẹlẹda Amazon awọn ẹya bii Amazon SageMaker Pipelines, Amazon SageMaker Debugger, tabi awọn akọọlẹ apoti. Awoṣe naa ti wa ni ransogun ni agbegbe aabo AWS ati labẹ awọn iṣakoso VPC rẹ, ṣe iranlọwọ lati pese aabo data.

Ṣawari awọn awoṣe ni SageMaker JumpStart

O le wọle si awoṣe DBRX nipasẹ SageMaker JumpStart ni SageMaker Studio UI ati SageMaker Python SDK. Ni apakan yii, a lọ lori bii o ṣe le ṣawari awọn awoṣe ni ile-iṣere SageMaker.

SageMaker Studio jẹ agbegbe idagbasoke idagbasoke (IDE) ti o pese wiwo wiwo orisun wẹẹbu kan nibiti o le wọle si awọn irinṣẹ idii lati ṣe gbogbo awọn igbesẹ idagbasoke ML, lati ngbaradi data si kikọ, ikẹkọ, ati gbigbe awọn awoṣe ML rẹ ṣiṣẹ. Fun awọn alaye diẹ sii lori bi o ṣe le bẹrẹ ati ṣeto SageMaker Studio, tọka si Amazon SageMaker Studio.

Ni SageMaker Studio, o le wọle si SageMaker JumpStart nipa yiyan fo ibere ninu ohun elo lilọ kiri.

Lati oju-iwe ibalẹ SageMaker JumpStart, o le wa “DBRX” ninu apoti wiwa. Awọn abajade wiwa yoo ṣe atokọ DBRX Ilana ati DBRX Ipilẹ.

O le yan kaadi awoṣe lati wo awọn alaye nipa awoṣe gẹgẹbi iwe-aṣẹ, data ti a lo lati ṣe ikẹkọ, ati bii o ṣe le lo awoṣe. O yoo tun ri awọn ran awọn bọtini lati ran awọn awoṣe ki o si ṣẹda ohun endpoint.

Ran awọn awoṣe ni SageMaker JumpStart

Imuṣiṣẹ bẹrẹ nigbati o yan awọn ran awọn bọtini. Lẹhin ipari imuṣiṣẹ, iwọ yoo rii pe a ṣẹda aaye ipari kan. O le ṣe idanwo aaye ipari nipa gbigbe fifuye isanwo ibeere itọkasi ayẹwo tabi nipa yiyan aṣayan idanwo ni lilo SDK. Nigbati o ba yan aṣayan lati lo SDK, iwọ yoo rii koodu apẹẹrẹ ti o le lo ninu olootu iwe ajako ti o fẹ ni SageMaker Studio.

DBRX Ipilẹ

Lati ran lọ ni lilo SDK, a bẹrẹ nipa yiyan awoṣe Ipilẹ DBRX, ti a pato nipasẹ awọn model_id pẹlu iye huggingface-lm-dbrx-mimọ. O le ran eyikeyi awọn awoṣe ti o yan sori SageMaker pẹlu koodu atẹle. Bakanna, o le ran Ilana DBRX ni lilo ID awoṣe tirẹ.

from sagemaker.jumpstart.model import JumpStartModel

accept_eula = True

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

Eyi n gbe awoṣe sori SageMaker pẹlu awọn atunto aiyipada, pẹlu iru apẹẹrẹ aiyipada ati awọn atunto VPC aiyipada. O le yi awọn atunto wọnyi pada nipa sisọ pato awọn iye ti kii ṣe aiyipada ni JumpStartModel. Iye Eula gbọdọ jẹ asọye ni gbangba bi Otitọ lati gba adehun iwe-aṣẹ olumulo ipari (EULA). Tun rii daju pe o ni opin iṣẹ-ipele iroyin fun lilo ml.p4d.24xlarge tabi ml.pde.24xlarge fun lilo ipari bi ọkan tabi diẹ sii awọn iṣẹlẹ. O le tẹle awọn ilana Nibi lati beere fun alekun ipin iṣẹ kan.

Lẹhin ti o ti gbe lọ, o le ṣiṣe itọkasi lodi si aaye ipari ti a fi ranṣẹ nipasẹ asọtẹlẹ SageMaker:

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

Apeere ta

O le ṣe ajọṣepọ pẹlu awoṣe Ipilẹ DBRX bii awoṣe iran ọrọ boṣewa eyikeyi, nibiti awoṣe ṣe ilana ilana titẹ sii ati awọn abajade asọtẹlẹ ti awọn ọrọ atẹle ni ọkọọkan. Ni apakan yii, a pese diẹ ninu awọn itọka apẹẹrẹ ati iṣelọpọ apẹẹrẹ.

Iran koodu

Lilo apẹẹrẹ ti iṣaaju, a le lo awọn itọka iran koodu bi atẹle:

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)

Eyi ni abajade:

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

Onínọmbà ero

O le ṣe itupalẹ itara nipa lilo itọka bi atẹle pẹlu 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)

Eyi ni abajade:

Idahun ibeere

O le lo idahun ibeere kan bi atẹle pẹlu 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)

Eyi ni abajade:

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 Ilana

Ẹya aifwy ẹkọ ti DBRX gba awọn ilana ti a ti pa akoonu nibiti awọn ipa ibaraẹnisọrọ gbọdọ bẹrẹ pẹlu itọsẹ lati ọdọ olumulo ati omiiran laarin awọn itọnisọna olumulo ati oluranlọwọ (DBRX-itọnisọna). Ọna kika itọnisọna gbọdọ wa ni ibọwọ muna, bibẹẹkọ awoṣe yoo ṣe agbejade awọn abajade suboptimal. Awoṣe lati kọ itọsi fun awoṣe Ilana jẹ asọye bi atẹle:

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

<|im_start|> ati <|im_end|> jẹ awọn ami pataki fun ibẹrẹ okun (BOS) ati opin okun (EOS). Awoṣe naa le ni awọn iyipada ibaraẹnisọrọ lọpọlọpọ laarin eto, olumulo, ati oluranlọwọ, gbigba fun iṣakojọpọ ti awọn apẹẹrẹ ibọn diẹ lati jẹki awọn idahun awoṣe.

Koodu atẹle yii fihan bi o ṣe le ṣe ọna kika itọsi ni ọna kika itọnisọna:

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")

Igbapada imo

O le lo itọsi atẹle fun imupadabọ imọ:

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)

Eyi ni abajade:

> 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.

Iran koodu

Awọn awoṣe DBRX ṣe afihan awọn agbara ala-ilẹ fun awọn iṣẹ ṣiṣe ifaminsi. Fun apẹẹrẹ, wo koodu atẹle:

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)

Eyi ni abajade:

> 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.

Iṣiro ati ero

Awọn awoṣe DBRX tun jabo awọn agbara ni deede mathematiki. Fun apẹẹrẹ, wo koodu atẹle:

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 le pese oye bi o ṣe han ninu iṣelọpọ atẹle pẹlu ọgbọn iṣiro:

> 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.

Nu kuro

Lẹhin ti o ti pari ṣiṣe iwe ajako, rii daju pe o paarẹ gbogbo awọn orisun ti o ṣẹda ninu ilana naa ki ìdíyelé rẹ ti duro. Lo koodu atẹle:

predictor.delete_model()
predictor.delete_endpoint()

ipari

Ninu ifiweranṣẹ yii, a fihan ọ bi o ṣe le bẹrẹ pẹlu DBRX ni ile-iṣere SageMaker ati mu awoṣe fun itọkasi. Nitoripe awọn awoṣe ipilẹ ti ni ikẹkọ tẹlẹ, wọn le ṣe iranlọwọ ikẹkọ kekere ati awọn idiyele amayederun ati mu isọdi ṣiṣẹ fun ọran lilo rẹ. Ṣabẹwo SageMaker JumpStart ni SageMaker Studio ni bayi lati bẹrẹ.

Oro


Nipa awọn onkọwe

Shikhar Kwatra jẹ Onitumọ Awọn Solusan Alamọja AI / ML ni Awọn iṣẹ Oju opo wẹẹbu Amazon, ti n ṣiṣẹ pẹlu oludari Alakoso Eto Agbaye kan. O ti gba akọle ti ọkan ninu Awọn Inventors Titunto ti Ilu India ti o kere ju pẹlu awọn itọsi 400 ni awọn agbegbe AI / ML ati IoT. O ni awọn ọdun 8 ti iriri ile-iṣẹ lati awọn ibẹrẹ si awọn ile-iṣẹ nla, lati ọdọ Onimọ-ẹrọ Iwadi IoT, Onimọ-jinlẹ data, si Data & AI Architect. Shikhar ṣe iranlọwọ ni titumọ, kikọ, ati mimu iye owo daradara, awọn agbegbe awọsanma iwọn fun awọn ẹgbẹ ati ṣe atilẹyin awọn alabaṣiṣẹpọ GSI ni kikọ ile-iṣẹ ilana

Niithin Vijeaswaran jẹ Onitumọ Awọn ojutu ni AWS. Agbegbe idojukọ rẹ jẹ ipilẹṣẹ AI ati AWS AI Accelerators. O ni oye oye oye ni Imọ-ẹrọ Kọmputa ati Bioinformatics. Niithiyn n ṣiṣẹ ni pẹkipẹki pẹlu ẹgbẹ Generative AI GTM lati jẹ ki awọn alabara AWS ṣiṣẹ ni awọn iwaju pupọ ati mu iyara gbigba wọn ti AI ipilẹṣẹ. O jẹ onijakidijagan ti Dallas Mavericks ati gbadun gbigba awọn sneakers.

Sebastian Bustillo jẹ Onitumọ Awọn ojutu ni AWS. O dojukọ awọn imọ-ẹrọ AI / ML pẹlu ifẹ ti o jinlẹ fun AI ti ipilẹṣẹ ati iṣiro awọn iyara. Ni AWS, o ṣe iranlọwọ fun awọn alabara lati ṣii iye iṣowo nipasẹ AI ipilẹṣẹ. Nigbati ko ba si ni ibi iṣẹ, o gbadun pipọn kofi pipe ti kofi pataki ati ṣawari agbaye pẹlu iyawo rẹ.

Armando Diaz jẹ Onitumọ Awọn ojutu ni AWS. O fojusi lori AI ipilẹṣẹ, AI / ML, ati awọn atupale data. Ni AWS, Armando ṣe iranlọwọ fun awọn alabara ti o ṣepọ awọn agbara AI ti ipilẹṣẹ gige-eti sinu awọn eto wọn, imudara imotuntun ati anfani ifigagbaga. Nigbati ko ba si nibi iṣẹ, o gbadun lilo akoko pẹlu iyawo ati ẹbi rẹ, irin-ajo, ati rin irin-ajo agbaye.

iranran_img

Titun oye

iranran_img