Meet StarChat2: Your Ultimate Coding Companion

Hello Learners…

Welcome to the blog…

Table Of Contents

  • Introduction
  • Meet StarChat2: Your Ultimate Coding Companion
  • StarChat2 Model Details
  • StarChat2 Model Performance
  • Run StarChat2 Model Using Transformers
  • Uses And Limitations Of StarChat2
  • StarChat2 Framework Versions
  • Summary
  • References

Introduction

In this post,Meet StarChat2: Your Ultimate Coding Companion,Our new coding buddy an open-source llm model by HuggingFace.

HuggingFace excited to release StarChat2 a fine-tuned BigCode Starcoder2 model with enhanced assistant and copilot skills to answer all our coding questions.

Meet StarChat2: Your Ultimate Coding Companion

StarChat is a series of language models that are trained to act as helpful coding assistants. StarChat2 is the latest model in the series, and is a fine-tuned version of StarCoder2 that was trained with SFT and DPO on a mix of synthetic datasets.

StarChat2 can help us:

  • Answer coding questions in over 216 languages, including Python, Java, C++ and more!  
  • Explain concepts and help debug your code.
  • Generate sample code for data visualizations and plots in Python
  • Iterate together to solve our coding errors

StarChat2 is SFT + DPO trained version of StarCoder with a new dataset mix out of public dataset.

Hugging Face Datadrove was used for deduplication & decontamination. StarChat achieves an HumanEval score of 71%, MT Bench of 7.7 and IFEval of 36%.

StartChat Playground:

When we open above url we can see as below. from which we can question answer with starchat2 model.

Meet StarChat2: Your Ultimate Coding Companion

StarChat2 Model:

StarChat2 Model Details

Model Description
  • Model type: A 16B parameter GPT-like model fine-tuned on a mix of publicly available, synthetic datasets.
  • Language(s) (NLP): Primarily English and 80+ programming languages.
  • License: BigCode Open RAIL-M v1
  • Finetuned from model: bigcode/starcoder2-15b
Model Sources

StarChat2 Model Performance

ModelMT BenchIFEvalHumanEval
starchat2-15b-v0.17.6635.1271.34
deepseek-coder-6.7b-instruct4.1714.2380.48
CodeLlama-13b-Instruct-hf6.8043.4450.60

Uses And Limitations Of StarChat2

The model was fine-tuned on a blend of chat, code, math, and reasoning datasets. As a result, the model can be used for chat and we can check out our demo to test its coding capabilities.

Run StarChat2 Model Using Transformers

Here’s how you can run the model using the pipeline() function from Transformers:

# pip install 'transformers @ git+https://github.com/huggingface/transformers.git@831bc25d8fdb85768402f772cf65cc3d7872b211'
# pip install accelerate

import torch
from transformers import pipeline

pipe = pipeline(
    "text-generation",
    model="HuggingFaceH4/starchat2-15b-v0.1",
    device_map="auto",
    torch_dtype=torch.bfloat16,
)
messages = [
    {
        "role": "system",
        "content": "You are StarChat2, an expert programming assistant",
    },
    {"role": "user", "content": "Write a simple website in HTML. When a user clicks the button, it shows a random Chuck Norris joke."},
]
outputs = pipe(
    messages,
    max_new_tokens=512,
    do_sample=True,
    temperature=0.7,
    top_k=50,
    top_p=0.95,
    stop_sequence="<|im_end|>",
)
print(outputs[0]["generated_text"][-1]["content"])

StarChat2 Framework Versions

  • Transformers 4.39.0.dev0
  • Pytorch 2.1.2+cu121
  • Datasets 2.16.1
  • Tokenizers 0.15.1

Summary

In summary, with the release of StarChat2, coding has never been more accessible.

Empowered by advanced AI capabilities, this invaluable tool promises to revolutionize coding experiences and empower developers worldwide. Dive in and unleash your coding potential today.

Know more about llm models,

References

Leave a Comment