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")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("xavierwoon/cesterllama") model = AutoModelForCausalLM.from_pretrained("xavierwoon/cesterllama", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use xavierwoon/cesterllama with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -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 serve -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
- Llama new
- 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 Desktop
- 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
- Atomic Chat
|
Download README.md from xavierwoon/cesterllama: direct link, hf CLI and curl.
- Browser
- Download file 6.27 kB
-
https://huggingface.co/xavierwoon/cesterllama/resolve/main/README.md
- Command line
-
hf download hf://xavierwoon/cesterllama/README.md
-
curl -L -o README.md https://huggingface.co/xavierwoon/cesterllama/resolve/main/README.md
6.27 kB
| library_name: transformers | |
| tags: | |
| - unsloth | |
| - trl | |
| - sft | |
| datasets: | |
| - xavierwoon/cestertrain | |
| base_model: | |
| - unsloth/llama-3-8b-bnb-4bit | |
| # Model Card for Model ID | |
| <!-- Provide a quick summary of what the model is/does. --> | |
| Cesterllama is a fine-tuned Llama 3 8B model that is able to generate Libcester unit test cases in the correct format. | |
| ## Model Details | |
| ### Model Description | |
| <!-- Provide a longer summary of what this model is. --> | |
| <!-- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated. --> | |
| - **Developed by:** Xavier Woon | |
| <!-- - **Funded by [optional]:** [More Information Needed] | |
| - **Shared by [optional]:** [More Information Needed] --> | |
| - **Model type:** Llama | |
| <!-- - **Language(s) (NLP):** [More Information Needed] | |
| - **License:** [More Information Needed] --> | |
| - **Finetuned from model [optional]:** unsloth/llama-3-8b-bnb-4bit | |
| <!-- ### Model Sources [optional] | |
| Provide the basic links for the model. | |
| - **Repository:** [More Information Needed] | |
| - **Paper [optional]:** [More Information Needed] | |
| - **Demo [optional]:** [More Information Needed] --> | |
| <!-- ## Uses --> | |
| <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. --> | |
| <!-- ### Direct Use --> | |
| <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. --> | |
| <!-- [More Information Needed] --> | |
| <!-- ### Downstream Use [optional] --> | |
| <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app --> | |
| <!-- [More Information Needed] --> | |
| <!-- ### Out-of-Scope Use --> | |
| <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. --> | |
| <!-- [More Information Needed] --> | |
| ## Bias, Risks, and Limitations | |
| <!-- This section is meant to convey both technical and sociotechnical limitations. --> | |
| 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`. | |
| ### Recommendations | |
| <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. --> | |
| Expanding the dataset will help increase the accuracy and robustness of the model, and improve code coverage based on real life scenarios. | |
| ## How to Get Started with the Model | |
| Use the code below to get started with the model. | |
| ```py | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_name = "xavierwoon/cesterllama" | |
| model = AutoModelForCausalLM.from_pretrained(model_name) | |
| tokenizer = AutoTokenizer.from_pretrained(model_name) | |
| # Paste your own code inside | |
| code = """ | |
| void add() | |
| { | |
| int a,b,c; | |
| printf("\nEnter The Two values:"); | |
| scanf("%d%d",&a,&b); | |
| c=a+b; | |
| printf("Addition:%d",c); | |
| } | |
| """ | |
| prompt = f"""### Instruction: | |
| create cester test cases for this function: | |
| {code} | |
| ### Input: | |
| ### Response: | |
| """ | |
| inputs = tokenizer(prompt, return_tensors="pt").to("cpu") | |
| from transformers import TextStreamer | |
| text_streamer = TextStreamer(tokenizer) | |
| _ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 2048) | |
| ``` | |
| <!-- [More Information Needed] --> | |
| ## Training Details | |
| ### Training Data | |
| <!-- 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. --> | |
| 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. | |
| ### Training Procedure | |
| <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. --> | |
| 1. Prompt GPT for sample DSA C code | |
| 2. Prompt GPT for Libcester unit test cases with 100% code coverage | |
| 3. Test generated test cases for robustness and code coverage | |
| <!-- #### Preprocessing [optional] | |
| [More Information Needed] | |
| --> | |
| <!-- #### Training Hyperparameters --> | |
| <!-- - **Training regime:** [More Information Needed] fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision --> | |
| <!-- #### Speeds, Sizes, Times [optional] --> | |
| <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. --> | |
| <!-- [More Information Needed] --> | |
| <!-- ## Evaluation --> | |
| <!-- This section describes the evaluation protocols and provides the results. --> | |
| <!-- ### Testing Data, Factors & Metrics --> | |
| <!-- #### Testing Data --> | |
| <!-- This should link to a Dataset Card if possible. --> | |
| <!-- [More Information Needed] --> | |
| <!-- #### Factors --> | |
| <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. --> | |
| <!-- [More Information Needed] --> | |
| <!-- #### Metrics --> | |
| <!-- These are the evaluation metrics being used, ideally with a description of why. --> | |
| <!-- [More Information Needed] --> | |
| <!-- ### Results --> | |
| <!-- [More Information Needed] --> | |
| <!-- #### Summary --> | |
| <!-- ## Model Examination [optional] --> | |
| <!-- Relevant interpretability work for the model goes here --> | |
| <!-- [More Information Needed] --> | |
| <!-- ## Technical Specifications [optional] | |
| ### Model Architecture and Objective | |
| [More Information Needed] | |
| ### Compute Infrastructure | |
| [More Information Needed] | |
| #### Hardware | |
| [More Information Needed] | |
| #### Software | |
| [More Information Needed] | |
| ## Citation [optional] --> | |
| <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. --> | |
| <!-- **BibTeX:** | |
| [More Information Needed] | |
| **APA:** | |
| [More Information Needed] | |
| ## Glossary [optional] --> | |
| <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. --> | |
| <!-- [More Information Needed] | |
| ## More Information [optional] | |
| [More Information Needed] | |
| ## Model Card Authors [optional] | |
| [More Information Needed] | |
| ## Model Card Contact | |
| [More Information Needed] --> |