Spaces:
Sleeping
Sleeping
File size: 1,622 Bytes
212d859 05cac50 212d859 05cac50 b9b90e5 05cac50 212d859 05cac50 b9b90e5 ac7dffa | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | ---
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.
|