Instructions to use RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf", filename="gemma-2b-it-finetune-python-codes.IQ3_M.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 RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf:Q4_K_M
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 RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf:Q4_K_M
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 RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf:Q4_K_M
Use Docker
docker model run hf.co/RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf with Ollama:
ollama run hf.co/RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf:Q4_K_M
- Unsloth Studio new
How to use RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-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 RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-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 RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf to start chatting
- Docker Model Runner
How to use RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf with Docker Model Runner:
docker model run hf.co/RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf:Q4_K_M
- Lemonade
How to use RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull RichardErkhov/shahdishank_-_gemma-2b-it-finetune-python-codes-gguf:Q4_K_M
Run and chat with the model
lemonade run user.shahdishank_-_gemma-2b-it-finetune-python-codes-gguf-Q4_K_M
List all available models
lemonade list
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Quantization made by Richard Erkhov.
gemma-2b-it-finetune-python-codes - GGUF
- Model creator: https://huggingface.co/shahdishank/
- Original model: https://huggingface.co/shahdishank/gemma-2b-it-finetune-python-codes/
Original model description:
license: gemma datasets: - flytech/python-codes-25k widget: - text: "write a simple python function" example_title: "Example 1" - text: "write a python program using flask" example_title: "Example 2" - text: "make a todo list using python" example_title: "Example 3" - text: "print current date and time using python" example_title: "Example 4" language: - en pipeline_tag: text-generation
Gemma-2b-it-finetuned-python-codes
This model card corresponds to the 2B finetuned version of the Gemma-2b-it model. You can visit the model card of the 2B Gemma Instruct.
Author: Dishank Shah
Description
GifPC-2b (Gemma-2b-it-finetuned-python-codes) LLM is trained on a dataset containing Python code snippets. This specialized training aimed to enhance Gemma-2b-it's understanding of Python syntax, semantics, and common programming patterns. With this finetuning, Gemma-2b-it is now proficient in not only comprehending Python code but also capable of assisting in debugging tasks. Users can leverage its trained knowledge to seek guidance on Python-related issues, understand code logic, and identify potential errors within their programs. This specialized Gemma-2b-it variant serves as a valuable tool for programmers seeking assistance and guidance in Python programming and debugging tasks.
Usage
Below we share some code snippets on how to get quickly started with running the model. First make sure to pip install -U transformers, then copy the snippet from the section that is relevant for your usecase.
Running the model on Google Colab CPU
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "shahdishank/gemma-2b-it-finetune-python-codes"
HUGGING_FACE_TOKEN = "YOUR_TOKEN"
tokenizer = AutoTokenizer.from_pretrained(model_name, token="HUGGING_FACE_TOKEN")
model = AutoModelForCausalLM.from_pretrained(model_name, token="HUGGING_FACE_TOKEN")
prompt_template = """\
user:\n{query} \n\n assistant:\n
"""
prompt = prompt_template.format(query="write a simple python function") # write your query here
input_ids = tokenizer(prompt, return_tensors="pt", add_special_tokens=True)
outputs = model.generate(**input_ids, max_new_tokens=2000, do_sample=True, pad_token_id=tokenizer.eos_token_id)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
Model Data
Data used for model training python-codes-25k.
Training Dataset
These models were trained on a dataset of text data that includes a wide variety of python codes. Here are the key components:
- Instruction: The instructional task to be performed / User input.
- Input: Very short, introductive part of AI response or empty.
- Output: Python code that accomplishes the task.
- Text: All fields combined together.
This diverse data source is crucial for training a powerful language model that can handle a wide variety of different tasks.
Usage
This LLM can be used for:
- Code generation
- Debugging
- Learn and understand various python coding styles
- Downloads last month
- 104
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit