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
|
@@ -83,6 +83,8 @@ We clean the content of the remaining dataset entries according to the following
|
|
| 83 |
* We remove all package lines, such as _package kotlinx.coroutines.channels_
|
| 84 |
* We remove half of the import lines
|
| 85 |
|
|
|
|
|
|
|
| 86 |
# Evaluation
|
| 87 |
|
| 88 |
For evaluation, we used the [Kotlin HumanEval](https://huggingface.co/datasets/JetBrains/Kotlin_HumanEval) dataset, which contains all 161 tasks from HumanEval translated into Kotlin by human experts. You can find more details about the pre-processing necessary to obtain our results, including the code for running, on the [datasets's page](https://huggingface.co/datasets/JetBrains/Kotlin_HumanEval).
|
|
|
|
| 83 |
* We remove all package lines, such as _package kotlinx.coroutines.channels_
|
| 84 |
* We remove half of the import lines
|
| 85 |
|
| 86 |
+
We removed half of the imports to avoid potential hallucinations by the model, where it might attempt to import unnecessary libraries. Additionally, packages were removed because this information is only useful at the project level and may introduce additional noise during the learning process.
|
| 87 |
+
|
| 88 |
# Evaluation
|
| 89 |
|
| 90 |
For evaluation, we used the [Kotlin HumanEval](https://huggingface.co/datasets/JetBrains/Kotlin_HumanEval) dataset, which contains all 161 tasks from HumanEval translated into Kotlin by human experts. You can find more details about the pre-processing necessary to obtain our results, including the code for running, on the [datasets's page](https://huggingface.co/datasets/JetBrains/Kotlin_HumanEval).
|