Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Home of StarCoder: fine-tuning & inference!
| Date | Stars |
|---|---|
| 2026-07-31 | 7505 |
| 2026-08-01 | 7503 |
| 2026-08-02 | 7503 |
| 2026-08-06 | 7503 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# 💫 StarCoder
[Paper](https://drive.google.com/file/d/1cN-b9GnWtHzQRoE7M7gAEyivY0kl4BYs/view) | [Model](https://huggingface.co/bigcode/starcoder) | [Playground](https://huggingface.co/spaces/bigcode/bigcode-playground) | [VSCode](https://marketplace.visualstudio.com/items?itemName=HuggingFace.huggingface-vscode) | [Chat](https://huggingface.co/spaces/HuggingFaceH4/starchat-playground)
# What is this about?
💫 StarCoder is a language model (LM) trained on source code and natural language text. Its training data incorporates more that 80 different programming languages as well as text extracted from GitHub issues and commits and from notebooks. This repository showcases how we get an overview of this LM's capabilities.
# News
* **May 9, 2023:** We've fine-tuned StarCoder to act as a helpful coding assistant 💬! Check out the `chat/` directory for the training code and play with the model [here](https://huggingface.co/spaces/HuggingFaceH4/starchat-playground).
# Disclaimer
Before you can use the model go to `hf.co/bigcode/starcoder` and accept the agreement. And make sure you are logged into the Hugging Face hub with:
```bash
huggingface-cli login
```
# Table of Contents
1. [Quickstart](#quickstart)
- [Installation](#installation)
- [Code generation with StarCoder](#code-generation)
- [Text-generation-inference code](#text-generation-inference)
2. [Fine-tuning](#fine-tuning)
- [Step by step installation with conda](#step-by-step-installation-with-conda)
- [Datasets](#datasets)
- [Stack Exchange](#stack-exchange-se)
- [Merging PEFT adapter layers](#merging-peft-adapter-layers)
3. [Evaluation](#evaluation)
4. [Inference hardware requirements](#inference-hardware-requirements)
# Quickstart
StarCoder was trained on GitHub code, thus it can be used to perform code generation. More precisely, the model can complete the implementation of a function or infer the following characters in a line of code. This can be done with the help of the 🤗's [transformers](https://github.com/huggingface/transformers) library.
## Installation
First, we have to install all the libraries listed in `requirements.txt`
```bash
pip install -r requirements.txt
```
## Code generation
The code generation pipeline is as follows
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "bigcode/starcoder"
device = "cuda" # for GPU usage or "cpu" for CPU usage
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
# to save memory consider using fp16 or bf16 by specifying torch_dtype=torch.float16 for example
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
outputs = model.generate(inputs)
# clean_up_tokenization_spaces=False prevents a tokenizer edge case which can result in spaces being removed around punctuation
print(tokenizer.decode(outputs[0], clean_up_tokenization_spaces=False))
```
or
```python
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
checkpoint = "bigcode/starcoder"
model = AutoModelForCausalLM.from_pretrained(checkpoint)
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, device=0)
print( pipe("def hello():") )
```
For hardware requirements, check the section [Inference hardware requirements](#inference-hardware-requirements).
## Text-generation-inference
```bash
docker run -p 8080:80 -v $PWD/data:/data -e HUGGING_FACE_HUB_TOKEN=<YOUR BIGCODE ENABLED TOKEN> -d ghcr.io/huggingface/text-generation-inference:latest --model-id bigcode/starcoder --max-total-tokens 8192
```
For more details, see [here](https://github.com/huggingface/text-generation-inference).
# Fine-tuning
Here, we showcase how we can fine-tune this LM on a specific downstream task.
## Step by step installation with conda
Create a new conda environment and activate it
```bash
conda create -n env
conda activate envExcerpt of 9,964 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:dde0e6728bd97152, desc:fine-tuning, desc:fine tuning