title: Code Generation with CodeT5
emoji: π»
colorFrom: yellow
colorTo: green
sdk: gradio
sdk_version: 5.20.1
app_file: app.py
pinned: false
license: mit
hf_oauth: true
hf_oauth_scopes:
- inference-api
short_description: ' This repository demonstrates how to leverage CodeT5-base'
π Code Generation with CodeT5
Welcome to the Code Generation with CodeT5 project! This repository demonstrates how to leverage the Salesforce/codet5-base
model for generating Python code snippets based on textual prompts. The project utilizes Gradio for creating interactive web interfaces and is deployed on Hugging Face Spaces.
π Repository Contents
Model Configuration:
Stored inconfig.json
, this file defines the architecture and settings of the CodeT5 model.Tokenizer Special Tokens:
Located inspecial_tokens_map.json
, it maps special tokens used during tokenization.Training Hyperparameters:
Found intraining_args.json
, this file contains parameters like learning rate, batch size, and number of epochs used during training.Inference Code:
Theapp.py
script loads the model and provides an interface for code generation.Dependencies:
Listed inrequirements.txt
, these are the necessary packages for running the model.Documentation:
ThisREADME.md
provides an overview and guide for setting up and using the repository.
π§ Setup & Usage
1. Clone the Repository
Clone the repository to your local machine:
git clone https://github.com/your-username/codegen-model-repo.git
cd codegen-model-repo
2. Install Dependencies
Install the required packages using pip:
pip install -r requirements.txt
3. Run the Gradio App
Launch the Gradio app to start generating code:
streamlit run app.py
Access the app in your browser to input prompts and receive generated code snippets.
π Deploying on Hugging Face Spaces
To deploy your Gradio app on Hugging Face Spaces:
Create a New Space:
- Visit Hugging Face Spaces and create a new Space.
- Select Gradio as the SDK.
Push Your Code:
- Initialize a Git repository in your project directory.
- Commit your code and push it to the new Space's repository.
For a detailed walkthrough on deploying Gradio apps to Hugging Face Spaces, refer to this tutorial.
π License
This project is licensed under the MIT License.