between-the-lines / README.md
coolbeanz79's picture
Update README.md
869fc3f verified
|
Raw
History Blame Contribute Delete
2.17 kB

A newer version of the Gradio SDK is available: 6.20.0

Upgrade
metadata
title: between-the-lines
emoji: 🟩
colorFrom: green
colorTo: gray
sdk: gradio
sdk_version: 5.50.0
app_file: app.py
pinned: false
tags:
  - build-small-hackathon
  - backyard-ai
  - tiny-titan
  - well-tuned
  - code
  - track:backyard
  - sponsor:modal
  - achievement:offgrid
  - achievement:offbrand
  - achievement:sharing

between-the-lines

A small-model code-reading assistant for Python files. It parses a single file deterministically, asks Mellum2 to add explanatory comments, and validates that the annotated output still parses to the same executable AST shape.

The app includes two modes:

  • Base Mellum2: richer comments from the base instruct model through Transformers.
  • Fine-tuned LoRA: a concise comment style trained on CodeSearchNet-derived Python examples with Modal.

The model never edits code directly. It only proposes comments, and the app rejects any annotated file whose semantic AST changes.

CLI Usage

Use the hosted Space from Node/npm without installing anything:

npx between-the-lines-cli path/to/file.py --model base --summary

By default, this creates an annotated sibling file next to the input:

path/to/file.annotated.py

You can also choose an output path or replace the input file:

npx between-the-lines-cli path/to/file.py --model base --output annotated.py
npx between-the-lines-cli path/to/file.py --model tuned --in-place

--model base uses the richer Mellum2 instruct path. --model tuned uses the LoRA adapter for shorter comments. Both modes run the AST validation before writing output.

Hackathon Fit

  • Track: Backyard AI
  • Interface: Gradio Space
  • Model: JetBrains Mellum2 12B-A2.5B Instruct, with a LoRA adapter for concise Python comments.
  • Training: LoRA SFT on Modal with examples from CodeSearchNet dataset
  • Correctness story: the model proposes comments only; Python AST parsing and validation guard against semantic edits.
  • Deployment: local/Space-hosted model inference, no external model API.

Demo Video Link: https://youtu.be/2cVZnw0t2g8

Post Link: https://x.com/bigbeanburt/status/2066668276462100883?s=20