Git Product home page Git Product logo

shahdishank / gemma-finetuned Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 36 KB

Gemma-2b-it LLM has been finetuned on a dataset of Python codes, enabling it to proficiently learn Python syntax and assist in debugging tasks, offering valuable guidance to programmers.

Home Page: https://huggingface.co/shahdishank/gemma-2b-it-finetune-python-codes

Jupyter Notebook 98.64% Python 1.36%
gemma gemma-2b-it google-gemma huggingface huggingface-datasets huggingface-transformers llm llm-finetuning

gemma-finetuned's Introduction

Finetuned Gemma LLM

A Finetuned Large Language Model specifically trained on datasets of python codes to teach python and help developers in debugging.

Model Link

Run Model on Google Colab CPU

  • Create read access token on Hugging Face [Here]

Install transformers library

pip install transformers

Use LLM on Google Colab to Generate Code

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)

Output on Google Colab Screenshot

llm_output

Features

  • Code generation
  • Debugging
  • Learn and understand various python coding styles

Tech Stack

Language: Python

Library: transformers, PEFT

LLM: Gemma-2b-it

IDE: Google Colab

Resources Used

Feedback

If you have any feedback, please reach out to me at [email protected]

Author

gemma-finetuned's People

Contributors

shahdishank avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.