GGUF
How to use from
Lemonade
Pull the model
# Download Lemonade from https://lemonade-server.ai/
lemonade pull vdpappu/gemma2_coding_assistant_gguf
Run and chat with the model
lemonade run user.gemma2_coding_assistant_gguf-{{QUANT_TAG}}
List all available models
lemonade list
Quick Links

Usage

from llama_cpp import Llama
from typing import Optional
import time
from huggingface_hub import hf_hub_download

def generate_prompt(input_text: str, instruction: Optional[str] = None) -> str:
    text = f"### Question: {input_text}\n\n### Answer: "
    if instruction:
        text = f"### Instruction: {instruction}\n\n{text}"
    return text

# Set up the parameters
repo_id = "vdpappu/gemma2_coding_assistant_gguf"
filename = "gemma2_coding.gguf"
local_dir = "."

downloaded_file_path = hf_hub_download(repo_id=repo_id, filename=filename, local_dir=local_dir)
print(f"File downloaded to: {downloaded_file_path}")

# Load the model 
llm = Llama(model_path=downloaded_file_path) #1 is thug
question = "Develop a Python program to clearly understand the concept of recursion."
prompt = generate_prompt(input_text=question)

start = time.time()
output = llm(prompt, 
             temperature=0.7,
             top_p=0.9,
             top_k=50,
             repeat_penalty=1.5,
             max_tokens=200, 
             stop=["Question:","<eos>"])
end = time.time()
print(f"Inference time: {end-start:.2f} seconds \n")
print(output['choices'][0]['text'])
Downloads last month
55
GGUF
Model size
3B params
Architecture
gemma
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train vdpappu/gemma2_coding_assistant_gguf