Instructions to use shahdishank/gemma-2b-it-finetune-python-codes with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shahdishank/gemma-2b-it-finetune-python-codes with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shahdishank/gemma-2b-it-finetune-python-codes") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("shahdishank/gemma-2b-it-finetune-python-codes") model = AutoModelForCausalLM.from_pretrained("shahdishank/gemma-2b-it-finetune-python-codes", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use shahdishank/gemma-2b-it-finetune-python-codes with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shahdishank/gemma-2b-it-finetune-python-codes" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shahdishank/gemma-2b-it-finetune-python-codes", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/shahdishank/gemma-2b-it-finetune-python-codes
- SGLang
How to use shahdishank/gemma-2b-it-finetune-python-codes 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 "shahdishank/gemma-2b-it-finetune-python-codes" \ --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": "shahdishank/gemma-2b-it-finetune-python-codes", "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 "shahdishank/gemma-2b-it-finetune-python-codes" \ --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": "shahdishank/gemma-2b-it-finetune-python-codes", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use shahdishank/gemma-2b-it-finetune-python-codes with Docker Model Runner:
docker model run hf.co/shahdishank/gemma-2b-it-finetune-python-codes
Updated README
Browse files
README.md
CHANGED
|
@@ -22,21 +22,13 @@ This model card corresponds to the 2B finetuned version of the Gemma-2b-it model
|
|
| 22 |
|
| 23 |
**Author**: Dishank Shah
|
| 24 |
|
| 25 |
-
## Model Information
|
| 26 |
-
|
| 27 |
-
Summary description and brief definition of inputs and outputs.
|
| 28 |
-
|
| 29 |
### Description
|
| 30 |
|
| 31 |
-
Gemma is
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
question answering, summarization, and reasoning. Their relatively small size
|
| 37 |
-
makes it possible to deploy them in environments with limited resources such as
|
| 38 |
-
a laptop, desktop or your own cloud infrastructure, democratizing access to
|
| 39 |
-
state of the art AI models and helping foster innovation for everyone.
|
| 40 |
|
| 41 |
### Usage
|
| 42 |
|
|
|
|
| 22 |
|
| 23 |
**Author**: Dishank Shah
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
### Description
|
| 26 |
|
| 27 |
+
GifPC-2b (Gemma-2b-it-finetuned-python-codes) LLM is trained on a dataset containing Python code snippets.
|
| 28 |
+
This specialized training aimed to enhance Gemma-2b-it's understanding of Python syntax, semantics, and common programming patterns.
|
| 29 |
+
With this finetuning, Gemma-2b-it is now proficient in not only comprehending Python code but also capable of assisting in debugging tasks.
|
| 30 |
+
Users can leverage its trained knowledge to seek guidance on Python-related issues, understand code logic, and identify potential errors within their programs.
|
| 31 |
+
This specialized Gemma-2b-it variant serves as a valuable tool for programmers seeking assistance and guidance in Python programming and debugging tasks.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
### Usage
|
| 34 |
|