Instructions to use vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling", dtype="auto") - llama-cpp-python
How to use vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling", filename="unsloth.Q8_0.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling:Q8_0 # Run inference directly in the terminal: llama-cli -hf vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling:Q8_0 # Run inference directly in the terminal: llama-cli -hf vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling:Q8_0
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 vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling:Q8_0
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 vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling:Q8_0
Use Docker
docker model run hf.co/vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling:Q8_0
- LM Studio
- Jan
- Ollama
How to use vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling with Ollama:
ollama run hf.co/vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling:Q8_0
- Unsloth Studio new
How to use vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling 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 vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling 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 vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling to start chatting
- Docker Model Runner
How to use vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling with Docker Model Runner:
docker model run hf.co/vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling:Q8_0
- Lemonade
How to use vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling:Q8_0
Run and chat with the model
lemonade run user.GEMMA-2-2B-it-GGUF-function_calling-Q8_0
List all available models
lemonade list
Uploaded model
- Developed by: vinimuchulski
- License: apache-2.0
- Finetuned from model : unsloth/gemma-2-2b-it-bnb-4bit
This gemma2 model was trained 2x faster with Unsloth and Huggingface's TRL library.
# Agente de Chamada de Fun莽茫o com LangChain e Prompt Personalizado
Este projeto implementa um agente baseado em LangChain com um prompt personalizado para realizar chamadas de fun莽茫o, utilizando o modelo `GEMMA-2-2B-it-GGUF-function_calling` hospedado no Hugging Face.
## Descri莽茫o
O c贸digo cria um agente que utiliza ferramentas personalizadas e um modelo de linguagem para responder perguntas com base em um fluxo estruturado de pensamento e a莽茫o. Ele inclui uma ferramenta personalizada (`get_word_length`) que calcula o comprimento de uma palavra e um prompt ReAct modificado para guiar o racioc铆nio do agente.
## Pr茅-requisitos
- Python 3.8+
- Bibliotecas necess谩rias:
```bash
pip install langchain langchain-ollama
C贸digo
Aqui est谩 o c贸digo principal:
from langchain.agents import AgentExecutor
from langchain.agents import tool, create_react_agent
from langchain import hub
from langchain_ollama.llms import OllamaLLM
from langchain.prompts import PromptTemplate
# Definir o modelo
MODEL = "hf.co/vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling:latest"
llm = OllamaLLM(model=MODEL)
# Criar ferramenta personalizada
@tool
def get_word_length(word: str) -> int:
"""Retorna o comprimento de uma palavra."""
return len(word)
# Definir prompt personalizado
custom_react_prompt = PromptTemplate(
input_variables=["input", "agent_scratchpad", "tools", "tool_names"],
template="""Answer the following questions as best you can. You have access to the following tools:
{tools}
Use the following format:
Question: the input question you must answer
Thought: you should always think about what to do
Action: the action to take, should be one of [{tool_names}]
Action Input: the input to the action, formatted as a string
Observation: the result of the action
Thought: I now know the final answer
Final Answer: the final answer to the original input question
Example:
Question: What is the length of the word "hello"?
Thought: I need to use the get_word_length tool to calculate the length of the word "hello".
Action: get_word_length
Action Input: "hello"
Observation: 5
Thought: I now know the length of the word "hello" is 5.
Final Answer: 5
Begin!
Question: {input}
Thought: {agent_scratchpad}"""
)
# Configurar ferramentas
tools = [get_word_length]
tools_str = "\n".join([f"{tool.name}: {tool.description}" for tool in tools])
tool_names = ", ".join([tool.name for tool in tools])
# Criar o agente
agent = create_react_agent(
tools=tools,
llm=llm,
prompt=custom_react_prompt.partial(tools=tools_str, tool_names=tool_names),
)
# Criar o executor
agent_executor = AgentExecutor(
agent=agent,
tools=tools,
verbose=True,
handle_parsing_errors=True
)
# Testar o agente
question = "What is the length of the word PythonDanelonAugustoTrajanoRomanovCzarVespasianoDiocleciano?"
response = agent_executor.invoke({"input": question})
print(response)
- Downloads last month
- 17
Hardware compatibility
Log In to add your hardware
8-bit
Inference Providers NEW
This model isn't deployed by any Inference Provider. 馃檵 Ask for provider support
Model tree for vinimuchulski/GEMMA-2-2B-it-GGUF-function_calling
Base model
unsloth/gemma-2-2b-it-bnb-4bit