Instructions to use JetBrains/CodeLlama-7B-Kexer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use JetBrains/CodeLlama-7B-Kexer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="JetBrains/CodeLlama-7B-Kexer")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("JetBrains/CodeLlama-7B-Kexer") model = AutoModelForCausalLM.from_pretrained("JetBrains/CodeLlama-7B-Kexer") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use JetBrains/CodeLlama-7B-Kexer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "JetBrains/CodeLlama-7B-Kexer" # 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-Kexer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/JetBrains/CodeLlama-7B-Kexer
- SGLang
How to use JetBrains/CodeLlama-7B-Kexer 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-Kexer" \ --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-Kexer", "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-Kexer" \ --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-Kexer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use JetBrains/CodeLlama-7B-Kexer with Docker Model Runner:
docker model run hf.co/JetBrains/CodeLlama-7B-Kexer
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
|
| 5 |
# Kexer models
|
|
@@ -37,6 +51,11 @@ generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
|
| 37 |
print(generated_text)
|
| 38 |
```
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
# Training setup
|
| 41 |
|
| 42 |
The model was trained on one A100 GPU with following hyperparameters:
|
|
@@ -62,10 +81,10 @@ To evaluate we used Kotlin Humaneval (more infromation here)
|
|
| 62 |
|
| 63 |
Fine-tuned model:
|
| 64 |
|
| 65 |
-
| **Model name** | **Kotlin HumanEval Pass Rate** |
|
| 66 |
-
|:---------------------------:|:----------------------------------------:|
|
| 67 |
-
| `base model` | 26.89 |
|
| 68 |
-
| `fine-tuned model` | 42.24 |
|
| 69 |
|
| 70 |
# Ethical Considerations and Limitations
|
| 71 |
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- JetBrains/KExercises
|
| 5 |
+
results:
|
| 6 |
+
- task:
|
| 7 |
+
type: text-generation
|
| 8 |
+
dataset:
|
| 9 |
+
name: MultiPL-HumanEval (Kotlin)
|
| 10 |
+
type: openai_humaneval
|
| 11 |
+
metrics:
|
| 12 |
+
- name: pass@1
|
| 13 |
+
type: pass@1
|
| 14 |
+
value: 42.24
|
| 15 |
+
tags:
|
| 16 |
+
- code
|
| 17 |
---
|
| 18 |
|
| 19 |
# Kexer models
|
|
|
|
| 51 |
print(generated_text)
|
| 52 |
```
|
| 53 |
|
| 54 |
+
As with the base model, we can use FIM. To do this, the following format must be used:
|
| 55 |
+
```
|
| 56 |
+
'<PRE> ' + prefix + ' <SUF> ' + suffix + ' <MID>'
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
# Training setup
|
| 60 |
|
| 61 |
The model was trained on one A100 GPU with following hyperparameters:
|
|
|
|
| 81 |
|
| 82 |
Fine-tuned model:
|
| 83 |
|
| 84 |
+
| **Model name** | **Kotlin HumanEval Pass Rate** |
|
| 85 |
+
|:---------------------------:|:----------------------------------------:|
|
| 86 |
+
| `base model` | 26.89 |
|
| 87 |
+
| `fine-tuned model` | 42.24 |
|
| 88 |
|
| 89 |
# Ethical Considerations and Limitations
|
| 90 |
|