ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Azure Databricks에서 생성 AI 및 LLMs 개발하기
    AI&ML 2024. 4. 10. 13:34
    반응형

    Azure Databricks는 데이터 수집 및 준비에서부터 모델 개발과 LLMOps, 서비스 및 모니터링에 이르는 AI 라이프사이클을 통합하는 통합 플랫폼을 제공한다.

     

    이 플랫폼은 생성 AI 애플리케이션 개발을 위해 최적화된 기능을 제공한다.

    작년에 Dolly 라는 자체 AI모델을 서비스 하는것을 본적이 있는데, 현재는 어떻게 서비스를 제공하는지 궁금했다.

    그래서 클라우드에서 Databricks를 배포하고 서비스 포털을 오픈해서 확인해보기로 한다.

    최근 웨비나 영상에서 openAI처럼 인공지능 모델들을 체험할수 있는 AI Playground를 제공한다고 하여, 기대하면서 워크스페이스를 열었다.

     

    하지만, 불행이도 Azure OpenAI 처럼 아직 한국리전에서는 이 기능을 제공하지 않는다.

    아래 Region availability를 참고하기 바란다.(2024.04.10일 기준)

    Region Location Core Model Serving capability * Foundation Model APIs (provisioned throughout) ** Foundation Model APIs (pay-per-token) External model
    australiacentral Australia Central        
    australiacentral2 Australia Central 2        
    australiaeast Australia East X X   X
    australiasoutheast Australia Southeast        
    brazilsouth Brazil South X X   X
    canadacentral Canada Central X X   X
    canadaeast Canada East        
    centralindia Central India X X   X
    centralus Central US X X X X
    chinaeast2 China East 2        
    chinaeast3 China East 3        
    chinanorth2 China North 2        
    chinanorth3 China North 3        
    eastasia East Asia        
    eastus East US X X X X
    eastus2 East US 2 X X X X
    eastus2euap East US 2 EUAP        
    francecentral France Central        
    germanywestcentral Germany West Central        
    japaneast Japan East        
    japanwest Japan West        
    koreacentral Korea Central        
    northcentralus North Central US X   X X
    northeurope North Europe X X   X
    norwayeast Norway East        
    qatarcentral Qatar Central        
    southafricanorth South Africa North        
    southcentralus South Central US        
    southeastasia Southeast Asia X     X
    southindia South India        
    swedencentral Sweden Central        
    switzerlandnorth Switzerland North        
    switzerlandwest Switzerland West        
    uaenorth UAE North        
    uksouth UK South        
    ukwest UK West        
    westcentralus West Central US        
    westeurope West Europe X X   X
    westindia West India        
    westus West US X X   X
    westus2 West US 2        
    westus3 West US 3      

    https://learn.microsoft.com/en-us/azure/databricks/machine-learning/model-serving/model-serving-limits#regions

     

    Model Serving limits and regions - Azure Databricks

    Learn about model serving limits, quotas and region availability.

    learn.microsoft.com

     

    한국 리전을 삭제하고, East US 리전으로 배포하고 나니 아래처럼 머신러닝 카테고리 아래에 AI Playground를 확인할 수 있었다.

    아직은 Preview 상태이다. 테스트 목적으로 사용해 보면 좋을것 같다.

    기본으로 제공하는 모델들은 아래와 같다.

    몇개를 테스트 해보았는데 위 그림에 나오는 Mixtral-8x7B Instruct 모델이 가장 자연스런 응답을 주었다.

    잠깐 이모델에 대해서 살펴보면, 이 모델은 Mistral AI에 의해 훈련된 전문가 모델이다. 이 모델은 질문 응답, 요약 및 추출과 같은 다양한 작업에 사용할 수 있고, Mixtral은 최대 32K 토큰의 컨텍스트 길이를 처리할 수 있다. Mixtral은 영어, 프랑스어, 이탈리아어, 독일어 및 스페인어 등 다국어를 처리할 수 있고, 한국어도 잘 이해하고 답변하였다.

    Mixtral은 대부분의 벤치마크에서 Llama 2 70B 및 GPT3.5와 비슷하거나 조금더 좋은 성능을 보여준다고 알려져있고, 추론 과정에서 LLaMA 70B보다 4배 빠르다고 한다. 다른 대형 언어 모델과 마찬가지로 Mixtral-8x7B Instruct 모델은 사실적인 정보를 생성하는데 의존해서는 안된다. 이 모델이 편향되거나 모욕적인 출력을 생성할 수 있으니 조심해야하고. 위험을 줄이기 위해 Databricks는 Mistral의 안전 모드 설정을 할수 있게 옵션을 두었다.

    아래는 이 모델을 사용하는 예제이다.

    chat_response = client.chat(
        model="mistral-large-latest", 
        messages=ChatMessage(role="user", content="What is the best French cheese?"),
        safe_mode=True
    )
    

    아래에 Playground로 테스트한 몇가지를 보여주겠다.

    아무래도 학습된 데이터가 작년데이터인듯 싶다.

    그래도, 질문에 대한 답변은 자연스러웠다.

    아래 그림처럼 챗팅에 대한 설정 옵션들을 조정할 수 있다.

    아래처럼 코드 샘플도 참고할수 있었다.

    또 아래처럼 외부 AI모델인 openAI로 서빙모델로 만들수 있는 기능도 제공한다.

     

    좀더 쉽게 여러 AI모델을 서빙하면서 테스트 할수 있는것이 새로웠다.

    다음에는 직접 모델을 만들고 서빙하는 테스트를 해봐야겠다.

    데이터브릭스에서 AI모델을 사용해보지 못한분들에게 간단하게나마 도움이 되는 글이었으면 좋겠다.

    반응형

    댓글

Designed by Tistory.