|
--- |
|
license: llama2 |
|
base_model: meta-llama/CodeLlama-70b-Python-hf |
|
tags: |
|
- code |
|
- code-generation |
|
- tab-completion |
|
- python |
|
- llama |
|
- finetuned |
|
language: |
|
- code |
|
--- |
|
|
|
# Python Tab Completion CodeLlama 70B |
|
|
|
## Model Description |
|
|
|
This is a finetuned version of Code-Llama-70B specifically optimized for Python tab completion tasks. The model excels at predicting the next tokens in Python code, making it ideal for IDE autocomplete features and code assistance tools. |
|
|
|
## Intended Use |
|
|
|
- **Primary use case**: Python code tab completion in IDEs and code editors |
|
- **Secondary uses**: |
|
- Code generation |
|
- Code explanation |
|
- Python snippet completion |
|
|
|
## Usage |
|
|
|
### Quick Start |
|
|
|
```python |
|
from transformers import AutoModelForCausalLM, AutoTokenizer |
|
import torch |
|
|
|
model_id = "emissary-ai/Python-Tab-Completion-CodeLlama-70b" |
|
tokenizer = AutoTokenizer.from_pretrained(model_id) |
|
model = AutoModelForCausalLM.from_pretrained( |
|
model_id, |
|
torch_dtype=torch.float16, |
|
device_map="auto" |
|
) |
|
``` |
|
|
|
### Example: Complete Python code |
|
|
|
```python |
|
prompt = "def calculate_average(numbers):\n " |
|
inputs = tokenizer(prompt, return_tensors="pt") |
|
outputs = model.generate(**inputs, max_length=100, temperature=0.7) |
|
completion = tokenizer.decode(outputs[0], skip_special_tokens=True) |
|
print(completion) |
|
``` |
|
|
|
### Limitations |
|
|
|
- Optimized specifically for Python; performance on other languages may vary |
|
- Best suited for short to medium-length completions |
|
- May require significant computational resources due to model size (70B parameters) |
|
|
|
### Ethical Considerations |
|
|
|
- Should not be used as the sole tool for production code without human review |
|
- May reflect biases present in the training data |
|
- Generated code should be tested and validated before deployment |
|
|
|
# License |
|
|
|
This model is subject to the Meta Llama 2 Community License Agreement. By using this model, you agree to the terms of the Llama 2 license. |
|
|
|
# Citation |
|
|
|
If you use this model in your research or applications, please cite: |
|
```bibtex |
|
@misc{python-tab-completion-codellama-70b, |
|
author = {Emissary AI}, |
|
title = {Python Tab Completion CodeLlama 70B}, |
|
year = {2024}, |
|
publisher = {Hugging Face}, |
|
howpublished = {\url{https://huggingface.co/emissary-ai/Python-Tab-Completion-CodeLlama-70b}} |
|
} |
|
``` |
|
# Contact |
|
For questions or issues, please open an issue in the Community tab. |