Downloads · 30 days
18
6% of all-time downloads
jacobhoffmann/CodeLlama-13B-TestGen-Dart_v0.2
CodeLlama-13B-TestGen-Dart_v0.2 is a text generation model from jacobhoffmann. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as llama2.
This model card provides information about TestGen-Dart v0.2, a fine-tuned version of Meta's Code Llama 13B model, optimized for generating unit tests in Dart for mobile applications. This model was developed as part…
Downloads · 30 days
18
6% of all-time downloads
All-time downloads
323
Public
Repo size
52.1 GB
Likes
0
Public
Click a slice to open those files.
.bin26 GB · 100%
From the Hugging Face model README
This model card provides information about TestGen-Dart v0.2, a fine-tuned version of Meta's Code Llama 13B model, optimized for generating unit tests in Dart for mobile applications. This model was developed as part of a research project on enhancing transformer-based large language models (LLMs) for specific downstream tasks while ensuring cost efficiency and accessibility on standard consumer hardware.
TestGen-Dart v0.2 is a fine-tuned version of Code Llama 13B, specifically adapted for generating unit test cases for Dart code. This model demonstrates enhanced capabilities in producing syntactically and functionally correct test cases compared to its base model.
The model can be used in a zero-shot setting to generate unit tests in Dart. Provide the class code as input, and the model outputs structured unit tests using Dart's test package.
This model is suitable for integration into developer tools, IDE extensions, or continuous integration pipelines to automate test generation for Dart-based applications.
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("username/testgen-dart-v0.2")
model = AutoModelForCausalLM.from_pretrained("username/testgen-dart-v0.2")
# Prepare input
input_code = """
class Calculator {
int add(int a, int b) {
return a + b;
}
}
"""
prompt = f"Generate unit tests in Dart for the following class:\n{input_code}"
# Generate tests
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_length=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
The fine-tuning dataset consists of 16,252 Dart code-test pairs extracted from open-source GitHub repositories using Google BigQuery. The data was subjected to quality filtering and deduplication to ensure high relevance and consistency.
If you use this model in your research, please cite:
BibTeX:
@inproceedings{hoffmann2024testgen,
title={Generating Software Tests for Mobile Applications Using Fine-Tuned Large Language Models},
author={Hoffmann, Jacob and Frister, Demian},
booktitle={Proceedings of the 5th ACM/IEEE International Conference on Automation of Software Test (AST 2024)},
year={2024},
doi={10.1145/3644032.3644454}
}