CoolFace
Apppublic

DilipKY/code-gen-bot

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
App README

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

Code Generation Bot

This is a simple bot that generates Python code from natural language descriptions using the CodeGen-350M-mono model from Hugging Face.

How to Use

  1. 1.Enter a description of the code you want (e.g., "Write a function to calculate factorial").
  2. 2.Click "Generate Code" to see the output.
  3. 3.Review the generated code for correctness before copying it.

Tips

  • Be specific in your descriptions for better results (e.g., "Write a Python function to add two numbers and return the sum").
  • The generated code may need minor tweaks, as it’s AI-generated.

About

  • Model: Salesforce/codegen-350M-mono
  • Framework: Streamlit
  • Deployment: Hosted on Hugging Face Spaces

Example

  • Input: "Write a function to add two numbers"
  • Output:
python
  def add_numbers(a, b):
      return a + b