Update README.md
Browse files
README.md
CHANGED
|
@@ -4,15 +4,133 @@ emoji: ✨2️⃣✨
|
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: true
|
| 10 |
license: mit
|
| 11 |
short_description: Latest Coding Model By🤗Huggingface & Friends-101 languages!
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
-
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 5.12.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: true
|
| 10 |
license: mit
|
| 11 |
short_description: Latest Coding Model By🤗Huggingface & Friends-101 languages!
|
| 12 |
---
|
| 13 |
|
| 14 |
+
StarCoder2
|
| 15 |
|
| 16 |
+
🌟 Latest Coding Model By 🤗 Huggingface & Friends - Supports 101 Programming Languages! 🌟
|
| 17 |
|
| 18 |
+
StarCoder2 is an advanced coding model designed to support a wide range of programming tasks, from code generation to bug fixing, across 101 programming languages. With state-of-the-art performance and seamless integration, StarCoder2 is your go-to tool for coding excellence.
|
| 19 |
+
|
| 20 |
+
📜 License
|
| 21 |
+
|
| 22 |
+
StarCoder2 is distributed under the Apache 2.0 License.
|
| 23 |
+
|
| 24 |
+
🏅 Model Badges
|
| 25 |
+
|
| 26 |
+
Languages Supported: 101
|
| 27 |
+
|
| 28 |
+
Framework Compatibility: Hugging Face Transformers
|
| 29 |
+
|
| 30 |
+
Model Size: 15B Parameters
|
| 31 |
+
|
| 32 |
+
🌐 Model Capabilities
|
| 33 |
+
|
| 34 |
+
🗣 Languages Supported
|
| 35 |
+
|
| 36 |
+
StarCoder2 supports 101 programming languages, including but not limited to:
|
| 37 |
+
|
| 38 |
+
Python, JavaScript, Java, C++, Go, Rust, HTML, CSS, SQL, TypeScript, and more.
|
| 39 |
+
|
| 40 |
+
🚀 Performance
|
| 41 |
+
|
| 42 |
+
StarCoder2 achieves high accuracy and performance on multiple coding benchmarks, making it a reliable choice for complex programming tasks.
|
| 43 |
+
|
| 44 |
+
🔧 Tasks
|
| 45 |
+
|
| 46 |
+
StarCoder2 excels at:
|
| 47 |
+
|
| 48 |
+
Code Generation: Create boilerplate code or complete functions.
|
| 49 |
+
|
| 50 |
+
Code Completion: Predict the next lines of code with context.
|
| 51 |
+
|
| 52 |
+
Bug Fixing: Identify and resolve errors in your code.
|
| 53 |
+
|
| 54 |
+
📥 Installation and Usage
|
| 55 |
+
|
| 56 |
+
🛠 Installation
|
| 57 |
+
|
| 58 |
+
Ensure you have the Hugging Face Transformers library installed. You can do so by running:
|
| 59 |
+
|
| 60 |
+
pip install git+https://github.com/huggingface/transformers.git
|
| 61 |
+
|
| 62 |
+
Alternatively, use the provided requirements.txt file:
|
| 63 |
+
|
| 64 |
+
pip install -r requirements.txt
|
| 65 |
+
|
| 66 |
+
💻 Usage Examples
|
| 67 |
+
|
| 68 |
+
Here’s how you can load the StarCoder2 model and generate code:
|
| 69 |
+
|
| 70 |
+
Python Code Example:
|
| 71 |
+
|
| 72 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 73 |
+
|
| 74 |
+
# Load the model and tokenizer
|
| 75 |
+
model_name = "bigcode/starcoder2-15b"
|
| 76 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 77 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True)
|
| 78 |
+
|
| 79 |
+
# Input prompt
|
| 80 |
+
prompt = "def fibonacci(n):"
|
| 81 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 82 |
+
|
| 83 |
+
# Generate code
|
| 84 |
+
outputs = model.generate(inputs["input_ids"], max_new_tokens=50)
|
| 85 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 86 |
+
|
| 87 |
+
JavaScript Code Example:
|
| 88 |
+
|
| 89 |
+
const { AutoModelForCausalLM, AutoTokenizer } = require('@huggingface/transformers');
|
| 90 |
+
|
| 91 |
+
async function generateCode() {
|
| 92 |
+
const modelName = 'bigcode/starcoder2-15b';
|
| 93 |
+
const tokenizer = await AutoTokenizer.from_pretrained(modelName);
|
| 94 |
+
const model = await AutoModelForCausalLM.from_pretrained(modelName);
|
| 95 |
+
|
| 96 |
+
const prompt = 'function calculateFactorial(num) {';
|
| 97 |
+
const inputs = tokenizer.encode(prompt, { return_tensors: 'pt' });
|
| 98 |
+
|
| 99 |
+
const output = await model.generate(inputs, { max_new_tokens: 50 });
|
| 100 |
+
console.log(tokenizer.decode(output[0]));
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
generateCode();
|
| 104 |
+
|
| 105 |
+
📚 Additional Resources
|
| 106 |
+
|
| 107 |
+
Hugging Face Model Hub
|
| 108 |
+
|
| 109 |
+
Explore StarCoder2 on Hugging Face: StarCoder2-15B Model Card
|
| 110 |
+
|
| 111 |
+
Configuration Reference
|
| 112 |
+
|
| 113 |
+
Detailed configuration options are available in the documentation.
|
| 114 |
+
|
| 115 |
+
📖 Citation
|
| 116 |
+
|
| 117 |
+
If you use StarCoder2 in your research or projects, please cite the following:
|
| 118 |
+
|
| 119 |
+
@misc{starcoder2,
|
| 120 |
+
author = {Huggingface and Friends},
|
| 121 |
+
title = {StarCoder2: A State-of-the-Art Coding Model},
|
| 122 |
+
year = {2025},
|
| 123 |
+
url = {https://huggingface.co/bigcode/starcoder2-15b/blob/main/README.md}
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
🤝 Community and Support
|
| 127 |
+
|
| 128 |
+
We welcome contributions and feedback from the community! Here’s how you can get involved:
|
| 129 |
+
|
| 130 |
+
Report Issues: Submit issues on GitHub.
|
| 131 |
+
|
| 132 |
+
Contribute: Fork the repository and make pull requests to improve StarCoder2.
|
| 133 |
+
|
| 134 |
+
Join Discussions: Participate in discussions on Hugging Face Forums.
|
| 135 |
+
|
| 136 |
+
Thank you for using StarCoder2! 🚀
|