--- title: Awkweave colorFrom: green colorTo: indigo sdk: gradio app_file: app.py pinned: false license: apache-2.0 models: - asterbraid/awkweave-1.5b - asterbraid/awkweave-0.5b datasets: - asterbraid/awkweave-data short_description: Generate and execute awk programs from plain language --- # Awkweave Enter a plain-language text-processing request and representative input. Awkweave generates an `awk` program and executes it locally in the Space with file, environment, pipe, and process access disabled. The demo offers [asterbraid/awkweave-1.5b](https://huggingface.co/asterbraid/awkweave-1.5b) for accuracy and [asterbraid/awkweave-0.5b](https://huggingface.co/asterbraid/awkweave-0.5b) for speed. It supports simple space-, tab-, and comma-separated input; quoted CSV is out of scope. Generated programs can be wrong, so review them before reuse. ## API usage Install the client and call either endpoint. The response contains the generated program, executed output, and status message. ```bash pip install gradio_client ``` ```python from gradio_client import Client client = Client("asterbraid/awkweave-demo") request = "For each record, print column 1 and the running sum of column 2, separated by a space." sample = "alice 10\nbruno 15\nchen 7\n" # Awkweave 1.5B large = client.predict(request, sample, api_name="/predict") print(large) # Awkweave 0.5B small = client.predict(request, sample, api_name="/predict_small") print(small) ``` Both should return the program `{s+=$2;print $1,s}` and output `alice 10\nbruno 25\nchen 32\n`. The original two-argument `/predict` signature is unchanged.