CoolFace
Modelpublic

xavierwoon/cesterllama

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes32downloads
README.md233 linesDownload Raw Back to root
1---2library_name: transformers3tags:4- unsloth5- trl6- sft7datasets:8- xavierwoon/cestertrain9base_model:10- unsloth/llama-3-8b-bnb-4bit11---12 13# Model Card for Model ID14 15<!-- Provide a quick summary of what the model is/does. -->16 17Cesterllama is a fine-tuned Llama 3 8B model that is able to generate Libcester unit test cases in the correct format.18 19## Model Details20 21### Model Description22 23<!-- Provide a longer summary of what this model is. -->24 25<!-- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated. -->26 27- **Developed by:** Xavier Woon28<!-- - **Funded by [optional]:** [More Information Needed]29- **Shared by [optional]:** [More Information Needed] -->30- **Model type:** Llama31<!-- - **Language(s) (NLP):** [More Information Needed]32- **License:** [More Information Needed] -->33- **Finetuned from model [optional]:** unsloth/llama-3-8b-bnb-4bit34 35<!-- ### Model Sources [optional]36 37Provide the basic links for the model.38 39- **Repository:** [More Information Needed]40- **Paper [optional]:** [More Information Needed]41- **Demo [optional]:** [More Information Needed] -->42 43<!-- ## Uses -->44 45<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->46 47<!-- ### Direct Use -->48 49<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->50 51<!-- [More Information Needed] -->52 53<!-- ### Downstream Use [optional] -->54 55<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->56 57<!-- [More Information Needed] -->58 59<!-- ### Out-of-Scope Use -->60 61<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->62 63<!-- [More Information Needed] -->64 65## Bias, Risks, and Limitations66 67<!-- This section is meant to convey both technical and sociotechnical limitations. -->68 69The model often regenerates the input prompt in the output. This can lead to limited test cases being printed due to truncations based on `max_new_tokens`.70 71### Recommendations72 73<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->74 75Expanding the dataset will help increase the accuracy and robustness of the model, and improve code coverage based on real life scenarios.76 77## How to Get Started with the Model78 79Use the code below to get started with the model.80 81```py82from transformers import AutoModelForCausalLM, AutoTokenizer83 84model_name = "xavierwoon/cesterllama"85model = AutoModelForCausalLM.from_pretrained(model_name)86tokenizer = AutoTokenizer.from_pretrained(model_name)87 88# Paste your own code inside89code = """90void add()91{92   int a,b,c;93   printf("\nEnter The Two values:");94   scanf("%d%d",&a,&b);95   c=a+b;96   printf("Addition:%d",c);97}98"""99 100prompt = f"""### Instruction:101create cester test cases for this function:102{code}103 104### Input:105 106### Response:107"""108 109inputs = tokenizer(prompt, return_tensors="pt").to("cpu")110 111from transformers import TextStreamer112text_streamer = TextStreamer(tokenizer)113_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 2048)114```115 116<!-- [More Information Needed] -->117 118## Training Details119 120### Training Data121 122<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->123 124Training Data was created based on Data Structures and Algorithm (DSA) codes created using ChatGPT. It would also create corresponding Cester test cases. After testing and ensuring a good code coverage, the prompt and corresponding test cases were added to the dataset.125 126### Training Procedure127 128<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->129 1301. Prompt GPT for sample DSA C code1312. Prompt GPT for Libcester unit test cases with 100% code coverage1323. Test generated test cases for robustness and code coverage133 134<!-- #### Preprocessing [optional]135 136[More Information Needed]137 -->138 139<!-- #### Training Hyperparameters -->140 141<!-- - **Training regime:** [More Information Needed] fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->142 143<!-- #### Speeds, Sizes, Times [optional] -->144 145<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->146 147<!-- [More Information Needed] -->148 149<!-- ## Evaluation -->150 151<!-- This section describes the evaluation protocols and provides the results. -->152 153<!-- ### Testing Data, Factors & Metrics -->154 155<!-- #### Testing Data -->156 157<!-- This should link to a Dataset Card if possible. -->158 159<!-- [More Information Needed] -->160 161<!-- #### Factors -->162 163<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->164 165<!-- [More Information Needed] -->166 167<!-- #### Metrics -->168 169<!-- These are the evaluation metrics being used, ideally with a description of why. -->170 171<!-- [More Information Needed] -->172 173<!-- ### Results -->174 175<!-- [More Information Needed] -->176 177<!-- #### Summary -->178 179 180 181<!-- ## Model Examination [optional] -->182 183<!-- Relevant interpretability work for the model goes here -->184 185<!-- [More Information Needed] -->186 187<!-- ## Technical Specifications [optional]188 189### Model Architecture and Objective190 191[More Information Needed]192 193### Compute Infrastructure194 195[More Information Needed]196 197#### Hardware198 199[More Information Needed]200 201#### Software202 203[More Information Needed]204 205## Citation [optional] -->206 207<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->208 209<!-- **BibTeX:**210 211[More Information Needed]212 213**APA:**214 215[More Information Needed]216 217## Glossary [optional] -->218 219<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->220 221<!-- [More Information Needed]222 223## More Information [optional]224 225[More Information Needed]226 227## Model Card Authors [optional]228 229[More Information Needed]230 231## Model Card Contact232 233[More Information Needed] -->