Instructions to use JetBrains/CodeLlama-7B-KStack with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use JetBrains/CodeLlama-7B-KStack with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="JetBrains/CodeLlama-7B-KStack")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("JetBrains/CodeLlama-7B-KStack") model = AutoModelForCausalLM.from_pretrained("JetBrains/CodeLlama-7B-KStack") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use JetBrains/CodeLlama-7B-KStack with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "JetBrains/CodeLlama-7B-KStack" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JetBrains/CodeLlama-7B-KStack", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/JetBrains/CodeLlama-7B-KStack
- SGLang
How to use JetBrains/CodeLlama-7B-KStack with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "JetBrains/CodeLlama-7B-KStack" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JetBrains/CodeLlama-7B-KStack", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "JetBrains/CodeLlama-7B-KStack" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JetBrains/CodeLlama-7B-KStack", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use JetBrains/CodeLlama-7B-KStack with Docker Model Runner:
docker model run hf.co/JetBrains/CodeLlama-7B-KStack
Update README.md
Browse files
README.md
CHANGED
|
@@ -18,9 +18,20 @@ tags:
|
|
| 18 |
|
| 19 |
# KStack-full models
|
| 20 |
|
| 21 |
-
KStack-full models is a collection of fine-tuned open-source generative text models fine-tuned on KStack dataset.
|
| 22 |
This is a repository for fine-tuned CodeLlama-7b model in the Hugging Face Transformers format.
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
# Model use
|
| 25 |
|
| 26 |
```python
|
|
|
|
| 18 |
|
| 19 |
# KStack-full models
|
| 20 |
|
| 21 |
+
KStack-full models is a collection of fine-tuned open-source generative text models fine-tuned on KStack dataset with rule-based filtering.
|
| 22 |
This is a repository for fine-tuned CodeLlama-7b model in the Hugging Face Transformers format.
|
| 23 |
|
| 24 |
+
## Rule-based filtering
|
| 25 |
+
To increase the quality of the dataset and filter out statistical outliers such as homework assignments, we filter out the dataset entries according to the following rules:
|
| 26 |
+
* We filter out files which belong to the low-popular repos (the sum of stars and forks is less than 6)
|
| 27 |
+
* Next, we filter out files which belong to the repos with less than 5 Kotlin files
|
| 28 |
+
* Finally, we remove files which have less than 20 SLOC
|
| 29 |
+
|
| 30 |
+
We clean the content of the remaining dataset entries according to the following rules:
|
| 31 |
+
* We remove all non-ASCII entries
|
| 32 |
+
* We remove all package lines such as _package kotlinx.coroutines.channels_
|
| 33 |
+
* We remove half of the import lines.
|
| 34 |
+
|
| 35 |
# Model use
|
| 36 |
|
| 37 |
```python
|