Instructions to use DiTy/gemma-2-27b-it-function-calling-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DiTy/gemma-2-27b-it-function-calling-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DiTy/gemma-2-27b-it-function-calling-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("DiTy/gemma-2-27b-it-function-calling-GGUF") model = AutoModelForCausalLM.from_pretrained("DiTy/gemma-2-27b-it-function-calling-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use DiTy/gemma-2-27b-it-function-calling-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="DiTy/gemma-2-27b-it-function-calling-GGUF", filename="gemma-2-27B-it-function-calling-Q6_K.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use DiTy/gemma-2-27b-it-function-calling-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf DiTy/gemma-2-27b-it-function-calling-GGUF:Q6_K # Run inference directly in the terminal: llama-cli -hf DiTy/gemma-2-27b-it-function-calling-GGUF:Q6_K
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf DiTy/gemma-2-27b-it-function-calling-GGUF:Q6_K # Run inference directly in the terminal: llama-cli -hf DiTy/gemma-2-27b-it-function-calling-GGUF:Q6_K
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 DiTy/gemma-2-27b-it-function-calling-GGUF:Q6_K # Run inference directly in the terminal: ./llama-cli -hf DiTy/gemma-2-27b-it-function-calling-GGUF:Q6_K
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 DiTy/gemma-2-27b-it-function-calling-GGUF:Q6_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf DiTy/gemma-2-27b-it-function-calling-GGUF:Q6_K
Use Docker
docker model run hf.co/DiTy/gemma-2-27b-it-function-calling-GGUF:Q6_K
- LM Studio
- Jan
- vLLM
How to use DiTy/gemma-2-27b-it-function-calling-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DiTy/gemma-2-27b-it-function-calling-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DiTy/gemma-2-27b-it-function-calling-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/DiTy/gemma-2-27b-it-function-calling-GGUF:Q6_K
- SGLang
How to use DiTy/gemma-2-27b-it-function-calling-GGUF 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 "DiTy/gemma-2-27b-it-function-calling-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DiTy/gemma-2-27b-it-function-calling-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "DiTy/gemma-2-27b-it-function-calling-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DiTy/gemma-2-27b-it-function-calling-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use DiTy/gemma-2-27b-it-function-calling-GGUF with Ollama:
ollama run hf.co/DiTy/gemma-2-27b-it-function-calling-GGUF:Q6_K
- Unsloth Studio new
How to use DiTy/gemma-2-27b-it-function-calling-GGUF 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 DiTy/gemma-2-27b-it-function-calling-GGUF 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 DiTy/gemma-2-27b-it-function-calling-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for DiTy/gemma-2-27b-it-function-calling-GGUF to start chatting
- Docker Model Runner
How to use DiTy/gemma-2-27b-it-function-calling-GGUF with Docker Model Runner:
docker model run hf.co/DiTy/gemma-2-27b-it-function-calling-GGUF:Q6_K
- Lemonade
How to use DiTy/gemma-2-27b-it-function-calling-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull DiTy/gemma-2-27b-it-function-calling-GGUF:Q6_K
Run and chat with the model
lemonade run user.gemma-2-27b-it-function-calling-GGUF-Q6_K
List all available models
lemonade list
Finetuning possible?
Hi!
Attempting to use this model for a specific use case in nutrition. Just wondering is further finetuning on this model possible?
Hey, I'm not sure if I understand you correctly.
- If you mean calls to specific functions related to the nutrition domain, then you do not need to fine-tune anything further. I have specially trained the model so that you can use any functions with any domains.
- But if you mean additional fine-tuning this model on specific domain (data about nutriton), it is quite possible that you will find yourself at an unpleasant crossroads with catastrophically forgetting about the tasks of the model that I have trained.
In this model finetuning I have used limited number of data (no more than 200 examples) and LoRa with only 1 epoch of training.
I hope this answers your question.
Just realising my question wasn't very clear. Yes, I meant additional finetuning. Thank you for the quick response!