ITR / README.md
Deepan13's picture
with some changes with access
14a4094

A newer version of the Gradio SDK is available: 5.29.1

Upgrade
metadata
title: CodeLlama Code Generator
emoji: 🦙
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 4.19.2
app_file: app.py
pinned: false
license: bigscience-openrail-m
short_description: Interactive CodeLlama code generation demo

CodeLlama Code Generator

This is an interactive demo of the CodeLlama-7b model for generating code completions. The application provides a simple interface where you can enter a code prompt and get AI-generated code completions.

Features

  • Interactive code generation with CodeLlama-7b model
  • Adjustable parameters (temperature, max length, etc.)
  • Example prompts to get started quickly
  • Real-time generation with timing information

How to Use

  1. Enter a code prompt in the input box (e.g., a function signature or class definition)
  2. Adjust the generation parameters if needed:
    • Max Length: Controls the maximum length of the generated text
    • Temperature: Controls randomness (lower = more deterministic)
    • Top-p: Controls diversity via nucleus sampling
    • Top-k: Controls diversity via top-k sampling
  3. Click "Generate Code" to get your completion
  4. Try different prompts and parameters to see how they affect the output

Examples

The demo includes several example prompts to help you get started:

  • Function to implement exponential backoff for network pings
  • Fibonacci sequence implementation
  • Binary search tree class
  • Asynchronous data fetching function

Authentication Requirements

Important: CodeLlama is a gated model that requires authentication to access. To use this demo:

  1. You must accept the model's license at meta-llama/CodeLlama-7b-hf
  2. You need to set your Hugging Face token in the Space's settings:
    • Go to Settings > Repository Secrets > Add
    • Create a secret named HF_TOKEN with your Hugging Face token as the value

Without proper authentication, the demo will show a limited interface with instructions.

Technical Details

This demo uses:

  • CodeLlama-7b model from Meta
  • Hugging Face Transformers library
  • Gradio for the web interface

License

This demo is provided under the BigScience OpenRAIL-M license.