Instructions to use xavierwoon/cesterllama with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xavierwoon/cesterllama with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="xavierwoon/cesterllama")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("xavierwoon/cesterllama") model = AutoModelForCausalLM.from_pretrained("xavierwoon/cesterllama") - llama-cpp-python
How to use xavierwoon/cesterllama with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="xavierwoon/cesterllama", filename="unsloth.F16.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use xavierwoon/cesterllama with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf xavierwoon/cesterllama:F16 # Run inference directly in the terminal: llama-cli -hf xavierwoon/cesterllama:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf xavierwoon/cesterllama:F16 # Run inference directly in the terminal: llama-cli -hf xavierwoon/cesterllama:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf xavierwoon/cesterllama:F16 # Run inference directly in the terminal: ./llama-cli -hf xavierwoon/cesterllama:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf xavierwoon/cesterllama:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf xavierwoon/cesterllama:F16
Use Docker
docker model run hf.co/xavierwoon/cesterllama:F16
- LM Studio
- Jan
- vLLM
How to use xavierwoon/cesterllama with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xavierwoon/cesterllama" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xavierwoon/cesterllama", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/xavierwoon/cesterllama:F16
- SGLang
How to use xavierwoon/cesterllama 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 "xavierwoon/cesterllama" \ --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": "xavierwoon/cesterllama", "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 "xavierwoon/cesterllama" \ --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": "xavierwoon/cesterllama", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use xavierwoon/cesterllama with Ollama:
ollama run hf.co/xavierwoon/cesterllama:F16
- Unsloth Studio new
How to use xavierwoon/cesterllama with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for xavierwoon/cesterllama to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for xavierwoon/cesterllama to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for xavierwoon/cesterllama to start chatting
- Docker Model Runner
How to use xavierwoon/cesterllama with Docker Model Runner:
docker model run hf.co/xavierwoon/cesterllama:F16
- Lemonade
How to use xavierwoon/cesterllama with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull xavierwoon/cesterllama:F16
Run and chat with the model
lemonade run user.cesterllama-F16
List all available models
lemonade list
Update README.md
Browse files
README.md
CHANGED
|
@@ -6,13 +6,15 @@ tags:
|
|
| 6 |
- sft
|
| 7 |
datasets:
|
| 8 |
- xavierwoon/cestertrain
|
|
|
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
# Model Card for Model ID
|
| 12 |
|
| 13 |
<!-- Provide a quick summary of what the model is/does. -->
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
## Model Details
|
| 18 |
|
|
@@ -20,26 +22,29 @@ datasets:
|
|
| 20 |
|
| 21 |
<!-- Provide a longer summary of what this model is. -->
|
| 22 |
|
| 23 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
| 24 |
|
| 25 |
- **Developed by:** Xavier Woon
|
| 26 |
-
- **
|
| 27 |
-
- **
|
| 28 |
-
- **
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
<!-- ### Model Sources [optional]
|
| 31 |
|
| 32 |
-
|
| 33 |
|
| 34 |
-
|
| 35 |
- **Paper [optional]:** [More Information Needed]
|
| 36 |
- **Demo [optional]:** [More Information Needed] -->
|
| 37 |
|
| 38 |
-
## Uses
|
| 39 |
|
| 40 |
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 41 |
|
| 42 |
-
### Direct Use
|
| 43 |
|
| 44 |
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 45 |
|
|
@@ -61,42 +66,79 @@ This is the model card of a 🤗 transformers model that has been pushed on the
|
|
| 61 |
|
| 62 |
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 63 |
|
| 64 |
-
|
| 65 |
|
| 66 |
-
|
| 67 |
|
| 68 |
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 69 |
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
<!-- [More Information Needed] -->
|
| 77 |
|
| 78 |
## Training Details
|
| 79 |
|
| 80 |
-
Trained with 3 epochs.
|
| 81 |
-
|
| 82 |
### Training Data
|
| 83 |
|
| 84 |
<!-- 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. -->
|
| 85 |
|
| 86 |
-
|
| 87 |
|
| 88 |
-
|
| 89 |
|
| 90 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 91 |
|
| 92 |
-
|
|
|
|
|
|
|
| 93 |
|
| 94 |
-
<!--
|
| 95 |
|
|
|
|
|
|
|
| 96 |
|
| 97 |
<!-- #### Training Hyperparameters -->
|
| 98 |
|
| 99 |
-
<!-- - **Training regime:** [More Information Needed]
|
| 100 |
|
| 101 |
<!-- #### Speeds, Sizes, Times [optional] -->
|
| 102 |
|
|
@@ -108,11 +150,9 @@ Trained with 3 epochs.
|
|
| 108 |
|
| 109 |
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 110 |
|
| 111 |
-
### Testing Data, Factors & Metrics
|
| 112 |
-
|
| 113 |
-
Code coverage and Robustness.
|
| 114 |
|
| 115 |
-
#### Testing Data
|
| 116 |
|
| 117 |
<!-- This should link to a Dataset Card if possible. -->
|
| 118 |
|
|
@@ -130,11 +170,11 @@ Code coverage and Robustness.
|
|
| 130 |
|
| 131 |
<!-- [More Information Needed] -->
|
| 132 |
|
| 133 |
-
### Results
|
| 134 |
|
| 135 |
<!-- [More Information Needed] -->
|
| 136 |
|
| 137 |
-
#### Summary
|
| 138 |
|
| 139 |
|
| 140 |
|
|
@@ -144,20 +184,7 @@ Code coverage and Robustness.
|
|
| 144 |
|
| 145 |
<!-- [More Information Needed] -->
|
| 146 |
|
| 147 |
-
<!-- ##
|
| 148 |
-
|
| 149 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 150 |
-
|
| 151 |
-
<!--
|
| 152 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 153 |
-
|
| 154 |
-
- **Hardware Type:** [More Information Needed]
|
| 155 |
-
- **Hours used:** [More Information Needed]
|
| 156 |
-
- **Cloud Provider:** [More Information Needed]
|
| 157 |
-
- **Compute Region:** [More Information Needed]
|
| 158 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 159 |
-
|
| 160 |
-
## Technical Specifications [optional]
|
| 161 |
|
| 162 |
### Model Architecture and Objective
|
| 163 |
|
|
@@ -175,11 +202,11 @@ Carbon emissions can be estimated using the [Machine Learning Impact calculator]
|
|
| 175 |
|
| 176 |
[More Information Needed]
|
| 177 |
|
| 178 |
-
## Citation [optional]
|
| 179 |
|
| 180 |
-
If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section.
|
| 181 |
|
| 182 |
-
**BibTeX:**
|
| 183 |
|
| 184 |
[More Information Needed]
|
| 185 |
|
|
@@ -187,11 +214,11 @@ If there is a paper or blog post introducing the model, the APA and Bibtex infor
|
|
| 187 |
|
| 188 |
[More Information Needed]
|
| 189 |
|
| 190 |
-
## Glossary [optional]
|
| 191 |
|
| 192 |
-
If relevant, include terms and calculations in this section that can help readers understand the model or model card.
|
| 193 |
|
| 194 |
-
[More Information Needed]
|
| 195 |
|
| 196 |
## More Information [optional]
|
| 197 |
|
|
|
|
| 6 |
- sft
|
| 7 |
datasets:
|
| 8 |
- xavierwoon/cestertrain
|
| 9 |
+
base_model:
|
| 10 |
+
- unsloth/llama-3-8b-bnb-4bit
|
| 11 |
---
|
| 12 |
|
| 13 |
# Model Card for Model ID
|
| 14 |
|
| 15 |
<!-- Provide a quick summary of what the model is/does. -->
|
| 16 |
|
| 17 |
+
Cesterllama is a fine-tuned Llama 3 8B model that is able to generate Libcester unit test cases in the correct format.
|
| 18 |
|
| 19 |
## Model Details
|
| 20 |
|
|
|
|
| 22 |
|
| 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 Woon
|
| 28 |
+
<!-- - **Funded by [optional]:** [More Information Needed]
|
| 29 |
+
- **Shared by [optional]:** [More Information Needed] -->
|
| 30 |
+
- **Model type:** Llama
|
| 31 |
+
<!-- - **Language(s) (NLP):** [More Information Needed]
|
| 32 |
+
- **License:** [More Information Needed] -->
|
| 33 |
+
- **Finetuned from model [optional]:** unsloth/llama-3-8b-bnb-4bit
|
| 34 |
|
| 35 |
+
<!-- ### Model Sources [optional]
|
| 36 |
|
| 37 |
+
Provide 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 |
|
|
|
|
| 66 |
|
| 67 |
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 68 |
|
| 69 |
+
The 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 |
+
### Recommendations
|
| 72 |
|
| 73 |
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 74 |
|
| 75 |
+
Expanding 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 Model
|
| 78 |
+
|
| 79 |
+
Use the code below to get started with the model.
|
| 80 |
+
|
| 81 |
+
```py
|
| 82 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 83 |
+
|
| 84 |
+
model_name = "xavierwoon/cesterllama"
|
| 85 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 86 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 87 |
+
|
| 88 |
+
# Paste your own code inside
|
| 89 |
+
code = """
|
| 90 |
+
void 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 |
+
|
| 100 |
+
prompt = f"""### Instruction:
|
| 101 |
+
create cester test cases for this function:
|
| 102 |
+
{code}
|
| 103 |
+
|
| 104 |
+
### Input:
|
| 105 |
+
|
| 106 |
+
### Response:
|
| 107 |
+
"""
|
| 108 |
|
| 109 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cpu")
|
| 110 |
|
| 111 |
+
from transformers import TextStreamer
|
| 112 |
+
text_streamer = TextStreamer(tokenizer)
|
| 113 |
+
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 2048)
|
| 114 |
+
```
|
| 115 |
|
| 116 |
<!-- [More Information Needed] -->
|
| 117 |
|
| 118 |
## Training Details
|
| 119 |
|
|
|
|
|
|
|
| 120 |
### Training Data
|
| 121 |
|
| 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 |
|
| 124 |
+
Training 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 Procedure
|
| 127 |
|
| 128 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 129 |
|
| 130 |
+
1. Prompt GPT for sample DSA C code
|
| 131 |
+
2. Prompt GPT for Libcester unit test cases with 100% code coverage
|
| 132 |
+
3. Test generated test cases for robustness and code coverage
|
| 133 |
|
| 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 |
|
|
|
|
| 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 |
|
|
|
|
| 170 |
|
| 171 |
<!-- [More Information Needed] -->
|
| 172 |
|
| 173 |
+
<!-- ### Results -->
|
| 174 |
|
| 175 |
<!-- [More Information Needed] -->
|
| 176 |
|
| 177 |
+
<!-- #### Summary -->
|
| 178 |
|
| 179 |
|
| 180 |
|
|
|
|
| 184 |
|
| 185 |
<!-- [More Information Needed] -->
|
| 186 |
|
| 187 |
+
<!-- ## Technical Specifications [optional]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
|
| 189 |
### Model Architecture and Objective
|
| 190 |
|
|
|
|
| 202 |
|
| 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 |
|
|
|
|
| 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 |
|