Spaces:
Running on Zero
Running on Zero
electblake commited on
Commit ·
7b43125
1
Parent(s): 508a5ff
Add Gradio NuExtract3 extraction app and launcher
Browse files- .agents/.gitignore +1 -0
- app/gradio.py +236 -0
- app/hf_space.py +0 -0
- data/samples/invoice-with-items.png +3 -0
- data/samples/receipt-ocr-original.webp +3 -0
- gradio.stderr.log +3 -0
- gradio.stdout.log +0 -0
- launch.py +28 -0
- mise.toml +1 -0
- pyproject.toml +8 -2
- uv.lock +123 -12
.agents/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
references
|
app/gradio.py
CHANGED
|
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pathlib import Path
|
| 2 |
+
|
| 3 |
+
import gradio as gr
|
| 4 |
+
import torch
|
| 5 |
+
from transformers import AutoModelForImageTextToText, AutoProcessor
|
| 6 |
+
|
| 7 |
+
model_id = "numind/NuExtract3"
|
| 8 |
+
|
| 9 |
+
structured_json_templates = {
|
| 10 |
+
"Basic receipt": """{
|
| 11 |
+
"merchant": "verbatim-string",
|
| 12 |
+
"purchase_date": "date",
|
| 13 |
+
"purchase_time": "time",
|
| 14 |
+
"total": "number",
|
| 15 |
+
"currency": "currency",
|
| 16 |
+
"item_count": "integer",
|
| 17 |
+
"paid": "boolean",
|
| 18 |
+
"payment_method": ["cash", "credit-card", "debit-card", "other"],
|
| 19 |
+
"items": ["verbatim-string"]
|
| 20 |
+
}""",
|
| 21 |
+
"Invoice with line items": """{
|
| 22 |
+
"document_type": "verbatim-string",
|
| 23 |
+
"vendor": {
|
| 24 |
+
"name": "verbatim-string",
|
| 25 |
+
"address": "verbatim-string",
|
| 26 |
+
"email": "email-address",
|
| 27 |
+
"phone": "phone-number"
|
| 28 |
+
},
|
| 29 |
+
"invoice_number": "verbatim-string",
|
| 30 |
+
"invoice_date": "verbatim-string",
|
| 31 |
+
"line_items": [
|
| 32 |
+
{
|
| 33 |
+
"description": "verbatim-string",
|
| 34 |
+
"category": ["product", "service", "shipping", "tax", "other"],
|
| 35 |
+
"quantity": "integer",
|
| 36 |
+
"unit_price": "number",
|
| 37 |
+
"unit": "unit-code",
|
| 38 |
+
"amount": "number"
|
| 39 |
+
}
|
| 40 |
+
],
|
| 41 |
+
"subtotal": "number",
|
| 42 |
+
"tax": "number",
|
| 43 |
+
"total": "number",
|
| 44 |
+
"currency": "currency"
|
| 45 |
+
}""",
|
| 46 |
+
"Advanced global record": """{
|
| 47 |
+
"summary": "string",
|
| 48 |
+
"reference_text": "verbatim-string",
|
| 49 |
+
"sequence_number": "integer",
|
| 50 |
+
"amount": "number",
|
| 51 |
+
"effective_date": "date",
|
| 52 |
+
"effective_time": "time",
|
| 53 |
+
"signed_at": "date-time",
|
| 54 |
+
"term": "duration",
|
| 55 |
+
"active": "boolean",
|
| 56 |
+
"country": "country",
|
| 57 |
+
"currency": "currency",
|
| 58 |
+
"language": "language",
|
| 59 |
+
"language_tag": "language-tag",
|
| 60 |
+
"script": "script",
|
| 61 |
+
"website": "url",
|
| 62 |
+
"email": "email-address",
|
| 63 |
+
"phone": "phone-number",
|
| 64 |
+
"iban": "iban",
|
| 65 |
+
"bic": "bic",
|
| 66 |
+
"measurement_unit": "unit-code",
|
| 67 |
+
"regions": {
|
| 68 |
+
"us": "region:US",
|
| 69 |
+
"fr": "region:FR",
|
| 70 |
+
"ie": "region:IE",
|
| 71 |
+
"gb": "region:GB",
|
| 72 |
+
"it": "region:IT",
|
| 73 |
+
"es": "region:ES",
|
| 74 |
+
"de": "region:DE",
|
| 75 |
+
"pt": "region:PT",
|
| 76 |
+
"ca": "region:CA",
|
| 77 |
+
"mx": "region:MX",
|
| 78 |
+
"br": "region:BR",
|
| 79 |
+
"au": "region:AU",
|
| 80 |
+
"jp": "region:JP",
|
| 81 |
+
"kr": "region:KR"
|
| 82 |
+
},
|
| 83 |
+
"contacts": [
|
| 84 |
+
{
|
| 85 |
+
"name": "verbatim-string",
|
| 86 |
+
"role": "string",
|
| 87 |
+
"email": "email-address"
|
| 88 |
+
}
|
| 89 |
+
],
|
| 90 |
+
"status": ["draft", "active", "expired", "unknown"],
|
| 91 |
+
"applicable_labels": [["legal", "financial", "technical", "personal"]],
|
| 92 |
+
"keywords": ["string"]
|
| 93 |
+
}""",
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
default_structured_json_template = "Invoice with line items"
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
def select_structured_json_template(name):
|
| 100 |
+
return structured_json_templates[name]
|
| 101 |
+
|
| 102 |
+
processor = AutoProcessor.from_pretrained(
|
| 103 |
+
model_id,
|
| 104 |
+
trust_remote_code=True,
|
| 105 |
+
)
|
| 106 |
+
|
| 107 |
+
model = AutoModelForImageTextToText.from_pretrained(
|
| 108 |
+
model_id,
|
| 109 |
+
dtype=torch.bfloat16,
|
| 110 |
+
device_map="auto",
|
| 111 |
+
trust_remote_code=True,
|
| 112 |
+
).eval()
|
| 113 |
+
|
| 114 |
+
|
| 115 |
+
def run_nuextract(messages, **chat_template_kwargs):
|
| 116 |
+
inputs = processor.apply_chat_template(
|
| 117 |
+
messages,
|
| 118 |
+
add_generation_prompt=True,
|
| 119 |
+
tokenize=True,
|
| 120 |
+
return_dict=True,
|
| 121 |
+
return_tensors="pt",
|
| 122 |
+
**chat_template_kwargs,
|
| 123 |
+
).to(model.device)
|
| 124 |
+
|
| 125 |
+
with torch.inference_mode():
|
| 126 |
+
generated_ids = model.generate( # pyright: ignore[reportAttributeAccessIssue]
|
| 127 |
+
**inputs,
|
| 128 |
+
max_new_tokens=4096,
|
| 129 |
+
do_sample=False,
|
| 130 |
+
)
|
| 131 |
+
|
| 132 |
+
generated_ids = generated_ids[:, inputs.input_ids.shape[1] :]
|
| 133 |
+
return processor.batch_decode(
|
| 134 |
+
generated_ids,
|
| 135 |
+
skip_special_tokens=True,
|
| 136 |
+
clean_up_tokenization_spaces=False,
|
| 137 |
+
)[0].strip()
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
def extract(image, text, mode, template, enable_thinking):
|
| 141 |
+
return run_nuextract(
|
| 142 |
+
[
|
| 143 |
+
{
|
| 144 |
+
"role": "user",
|
| 145 |
+
"content": [
|
| 146 |
+
{"type": "image", "image": image},
|
| 147 |
+
{"type": "text", "text": text},
|
| 148 |
+
],
|
| 149 |
+
}
|
| 150 |
+
],
|
| 151 |
+
mode=mode,
|
| 152 |
+
template=template,
|
| 153 |
+
enable_thinking=enable_thinking,
|
| 154 |
+
)
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
with gr.Blocks(title="NuExtract3") as demo:
|
| 158 |
+
gr.Markdown(
|
| 159 |
+
"# NuExtract3\n"
|
| 160 |
+
"Extract Markdown or structured JSON from an image and optional text."
|
| 161 |
+
)
|
| 162 |
+
with gr.Row():
|
| 163 |
+
with gr.Column():
|
| 164 |
+
image = gr.Image(label="Document image", type="pil", height=430)
|
| 165 |
+
text = gr.Textbox(
|
| 166 |
+
label="Document text (optional)",
|
| 167 |
+
placeholder="Add text to process alongside the image",
|
| 168 |
+
lines=3,
|
| 169 |
+
)
|
| 170 |
+
mode = gr.Radio(
|
| 171 |
+
["content", "structured"],
|
| 172 |
+
value="content",
|
| 173 |
+
label="Task",
|
| 174 |
+
)
|
| 175 |
+
template_preset = gr.Dropdown(
|
| 176 |
+
choices=list(structured_json_templates),
|
| 177 |
+
value=default_structured_json_template,
|
| 178 |
+
label="JSON template preset",
|
| 179 |
+
info="Choose a starting structure, then edit it below.",
|
| 180 |
+
)
|
| 181 |
+
template = gr.Textbox(
|
| 182 |
+
label="Structured JSON template",
|
| 183 |
+
value=structured_json_templates[default_structured_json_template],
|
| 184 |
+
lines=18,
|
| 185 |
+
info="Used for structured extraction. Edit the example to match your document.",
|
| 186 |
+
)
|
| 187 |
+
enable_thinking = gr.Checkbox(label="Enable thinking")
|
| 188 |
+
run = gr.Button("Extract", variant="primary")
|
| 189 |
+
output = gr.Textbox(label="Output", lines=28, buttons=["copy"])
|
| 190 |
+
|
| 191 |
+
gr.Examples(
|
| 192 |
+
examples=[
|
| 193 |
+
[
|
| 194 |
+
str(path),
|
| 195 |
+
"",
|
| 196 |
+
"content",
|
| 197 |
+
structured_json_templates[default_structured_json_template],
|
| 198 |
+
False,
|
| 199 |
+
]
|
| 200 |
+
for path in [
|
| 201 |
+
Path(__file__).parents[1]
|
| 202 |
+
/ "data"
|
| 203 |
+
/ "samples"
|
| 204 |
+
/ "receipt-ocr-original.webp",
|
| 205 |
+
Path(__file__).parents[1]
|
| 206 |
+
/ "data"
|
| 207 |
+
/ "samples"
|
| 208 |
+
/ "invoice-with-items.png",
|
| 209 |
+
*sorted(
|
| 210 |
+
path
|
| 211 |
+
for path in (
|
| 212 |
+
Path(__file__).parents[1] / "data" / "samples"
|
| 213 |
+
).glob("*.png")
|
| 214 |
+
if path.name != "invoice-with-items.png"
|
| 215 |
+
),
|
| 216 |
+
]
|
| 217 |
+
],
|
| 218 |
+
inputs=[image, text, mode, template, enable_thinking],
|
| 219 |
+
)
|
| 220 |
+
|
| 221 |
+
template_preset.change(
|
| 222 |
+
select_structured_json_template,
|
| 223 |
+
inputs=template_preset,
|
| 224 |
+
outputs=template,
|
| 225 |
+
)
|
| 226 |
+
|
| 227 |
+
run.click(
|
| 228 |
+
extract,
|
| 229 |
+
inputs=[image, text, mode, template, enable_thinking],
|
| 230 |
+
outputs=output,
|
| 231 |
+
api_name="extract",
|
| 232 |
+
)
|
| 233 |
+
|
| 234 |
+
|
| 235 |
+
if __name__ == "__main__":
|
| 236 |
+
demo.launch()
|
app/hf_space.py
ADDED
|
File without changes
|
data/samples/invoice-with-items.png
ADDED
|
Git LFS Details
|
data/samples/receipt-ocr-original.webp
ADDED
|
Git LFS Details
|
gradio.stderr.log
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
W0720 14:54:12.291000 61032 .venv\Lib\site-packages\torch\distributed\elastic\multiprocessing\redirects.py:29] NOTE: Redirects are currently not supported in Windows or MacOs.
|
| 2 |
+
[transformers] The fast path is not available because one of the required library is not installed. Falling back to torch implementation. To install follow https://github.com/fla-org/flash-linear-attention#installation and https://github.com/Dao-AILab/causal-conv1d
|
| 3 |
+
|
gradio.stdout.log
ADDED
|
File without changes
|
launch.py
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import argparse
|
| 2 |
+
import runpy
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
MODULES = {
|
| 6 |
+
"gradio": "app.gradio",
|
| 7 |
+
"hf_space": "app.hf_space",
|
| 8 |
+
"nuextract": "app.nuextract",
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def build_parser() -> argparse.ArgumentParser:
|
| 13 |
+
parser = argparse.ArgumentParser(description="Launch a NuMark application.")
|
| 14 |
+
parser.add_argument(
|
| 15 |
+
"app",
|
| 16 |
+
choices=MODULES,
|
| 17 |
+
help="Application to launch.",
|
| 18 |
+
)
|
| 19 |
+
return parser
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
def main() -> None:
|
| 23 |
+
args = build_parser().parse_args()
|
| 24 |
+
runpy.run_module(MODULES[args.app], run_name="__main__")
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
if __name__ == "__main__":
|
| 28 |
+
main()
|
mise.toml
CHANGED
|
@@ -5,3 +5,4 @@ uv = "latest"
|
|
| 5 |
|
| 6 |
[env]
|
| 7 |
UV_LINK_MODE="copy"
|
|
|
|
|
|
| 5 |
|
| 6 |
[env]
|
| 7 |
UV_LINK_MODE="copy"
|
| 8 |
+
PYTHONPATH=""
|
pyproject.toml
CHANGED
|
@@ -6,7 +6,7 @@ readme = "README.md"
|
|
| 6 |
requires-python = ">=3.12,<3.13"
|
| 7 |
dependencies = [
|
| 8 |
"accelerate>=1.14.0",
|
| 9 |
-
"flash-
|
| 10 |
"gguf>=0.19.0",
|
| 11 |
"gradio",
|
| 12 |
"huggingface-hub",
|
|
@@ -14,8 +14,13 @@ dependencies = [
|
|
| 14 |
"ipython>=9.15.0",
|
| 15 |
"ipywidgets>=8.1.8",
|
| 16 |
"openai>=2.46.0",
|
|
|
|
|
|
|
| 17 |
"torch==2.9.1",
|
|
|
|
|
|
|
| 18 |
"transformers",
|
|
|
|
| 19 |
]
|
| 20 |
|
| 21 |
[dependency-groups]
|
|
@@ -32,7 +37,8 @@ select = ["B", "E4", "E7", "E9", "F", "I", "SIM", "UP"]
|
|
| 32 |
|
| 33 |
[tool.uv.sources]
|
| 34 |
torch = { index = "pytorch-cu130" }
|
| 35 |
-
|
|
|
|
| 36 |
|
| 37 |
[[tool.uv.index]]
|
| 38 |
name = "pytorch-cu130"
|
|
|
|
| 6 |
requires-python = ">=3.12,<3.13"
|
| 7 |
dependencies = [
|
| 8 |
"accelerate>=1.14.0",
|
| 9 |
+
"flash-linear-attention>=0.5.1",
|
| 10 |
"gguf>=0.19.0",
|
| 11 |
"gradio",
|
| 12 |
"huggingface-hub",
|
|
|
|
| 14 |
"ipython>=9.15.0",
|
| 15 |
"ipywidgets>=8.1.8",
|
| 16 |
"openai>=2.46.0",
|
| 17 |
+
"pillow>=12.3.0",
|
| 18 |
+
"spaces>=0.51.0",
|
| 19 |
"torch==2.9.1",
|
| 20 |
+
"torchaudio==2.9.1",
|
| 21 |
+
"torchvision",
|
| 22 |
"transformers",
|
| 23 |
+
"triton-windows>=3.5.0.post21",
|
| 24 |
]
|
| 25 |
|
| 26 |
[dependency-groups]
|
|
|
|
| 37 |
|
| 38 |
[tool.uv.sources]
|
| 39 |
torch = { index = "pytorch-cu130" }
|
| 40 |
+
torchaudio = { index = "pytorch-cu130" }
|
| 41 |
+
torchvision = { index = "pytorch-cu130" }
|
| 42 |
|
| 43 |
[[tool.uv.index]]
|
| 44 |
name = "pytorch-cu130"
|
uv.lock
CHANGED
|
@@ -4,7 +4,8 @@ requires-python = "==3.12.*"
|
|
| 4 |
resolution-markers = [
|
| 5 |
"sys_platform == 'win32'",
|
| 6 |
"sys_platform == 'emscripten'",
|
| 7 |
-
"sys_platform != 'emscripten' and sys_platform != 'win32'",
|
|
|
|
| 8 |
]
|
| 9 |
|
| 10 |
[[package]]
|
|
@@ -251,21 +252,28 @@ wheels = [
|
|
| 251 |
]
|
| 252 |
|
| 253 |
[[package]]
|
| 254 |
-
name = "
|
| 255 |
-
version = "
|
| 256 |
-
source = {
|
| 257 |
dependencies = [
|
| 258 |
{ name = "einops" },
|
| 259 |
-
{ name = "torch" },
|
| 260 |
]
|
|
|
|
| 261 |
wheels = [
|
| 262 |
-
{ url = "https://
|
| 263 |
]
|
| 264 |
|
| 265 |
-
[package
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 269 |
]
|
| 270 |
|
| 271 |
[[package]]
|
|
@@ -698,7 +706,7 @@ version = "0.1.0"
|
|
| 698 |
source = { virtual = "." }
|
| 699 |
dependencies = [
|
| 700 |
{ name = "accelerate" },
|
| 701 |
-
{ name = "flash-
|
| 702 |
{ name = "gguf" },
|
| 703 |
{ name = "gradio" },
|
| 704 |
{ name = "huggingface-hub" },
|
|
@@ -706,8 +714,15 @@ dependencies = [
|
|
| 706 |
{ name = "ipython" },
|
| 707 |
{ name = "ipywidgets" },
|
| 708 |
{ name = "openai" },
|
|
|
|
|
|
|
| 709 |
{ name = "torch" },
|
|
|
|
|
|
|
|
|
|
|
|
|
| 710 |
{ name = "transformers" },
|
|
|
|
| 711 |
]
|
| 712 |
|
| 713 |
[package.dev-dependencies]
|
|
@@ -718,7 +733,7 @@ dev = [
|
|
| 718 |
[package.metadata]
|
| 719 |
requires-dist = [
|
| 720 |
{ name = "accelerate", specifier = ">=1.14.0" },
|
| 721 |
-
{ name = "flash-
|
| 722 |
{ name = "gguf", specifier = ">=0.19.0" },
|
| 723 |
{ name = "gradio" },
|
| 724 |
{ name = "huggingface-hub" },
|
|
@@ -726,8 +741,13 @@ requires-dist = [
|
|
| 726 |
{ name = "ipython", specifier = ">=9.15.0" },
|
| 727 |
{ name = "ipywidgets", specifier = ">=8.1.8" },
|
| 728 |
{ name = "openai", specifier = ">=2.46.0" },
|
|
|
|
|
|
|
| 729 |
{ name = "torch", specifier = "==2.9.1", index = "https://download.pytorch.org/whl/cu130" },
|
|
|
|
|
|
|
| 730 |
{ name = "transformers" },
|
|
|
|
| 731 |
]
|
| 732 |
|
| 733 |
[package.metadata.requires-dev]
|
|
@@ -1365,6 +1385,23 @@ wheels = [
|
|
| 1365 |
{ url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235, upload-time = "2024-02-25T23:20:01.196Z" },
|
| 1366 |
]
|
| 1367 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1368 |
[[package]]
|
| 1369 |
name = "stack-data"
|
| 1370 |
version = "0.6.3"
|
|
@@ -1474,6 +1511,72 @@ wheels = [
|
|
| 1474 |
{ url = "https://download-r2.pytorch.org/whl/cu130/torch-2.9.1%2Bcu130-cp312-cp312-win_amd64.whl", hash = "sha256:cd3232a562ad2a2699d48130255e1b24c07dfe694a40dcd24fad683c752de121", upload-time = "2026-01-26T16:37:50Z" },
|
| 1475 |
]
|
| 1476 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1477 |
[[package]]
|
| 1478 |
name = "tornado"
|
| 1479 |
version = "6.5.7"
|
|
@@ -1541,6 +1644,14 @@ wheels = [
|
|
| 1541 |
{ url = "https://files.pythonhosted.org/packages/f2/50/9a8358d3ef58162c0a415d173cfb45b67de60176e1024f71fbc4d24c0b6d/triton-3.5.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d2c6b915a03888ab931a9fd3e55ba36785e1fe70cbea0b40c6ef93b20fc85232", size = 170470207, upload-time = "2025-11-11T17:41:00.253Z" },
|
| 1542 |
]
|
| 1543 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1544 |
[[package]]
|
| 1545 |
name = "typer"
|
| 1546 |
version = "0.27.0"
|
|
|
|
| 4 |
resolution-markers = [
|
| 5 |
"sys_platform == 'win32'",
|
| 6 |
"sys_platform == 'emscripten'",
|
| 7 |
+
"(platform_machine != 'aarch64' and sys_platform == 'linux') or (platform_python_implementation != 'CPython' and sys_platform == 'linux') or (sys_platform != 'emscripten' and sys_platform != 'linux' and sys_platform != 'win32')",
|
| 8 |
+
"platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
| 9 |
]
|
| 10 |
|
| 11 |
[[package]]
|
|
|
|
| 252 |
]
|
| 253 |
|
| 254 |
[[package]]
|
| 255 |
+
name = "fla-core"
|
| 256 |
+
version = "0.5.1"
|
| 257 |
+
source = { registry = "https://pypi.org/simple" }
|
| 258 |
dependencies = [
|
| 259 |
{ name = "einops" },
|
|
|
|
| 260 |
]
|
| 261 |
+
sdist = { url = "https://files.pythonhosted.org/packages/4e/62/99e149f19a447ce809d7f4fa64ae61c073da337505b9db7f389502470820/fla_core-0.5.1.tar.gz", hash = "sha256:7f3cf56edfbaa9115f4937d1181372e5c7b11809ad8eb2e411fffc3caf729f48", size = 498800, upload-time = "2026-06-18T18:17:15.377Z" }
|
| 262 |
wheels = [
|
| 263 |
+
{ url = "https://files.pythonhosted.org/packages/ce/78/a55ee7a62515dcb9220770dd99dfe59ac6599da8af84ad1d20f9f407df4d/fla_core-0.5.1-py3-none-any.whl", hash = "sha256:02150d34aa1e37f6b8ed9b2feec5d29af93680573e5077ed981238179c11fb06", size = 702955, upload-time = "2026-06-18T18:17:12.229Z" },
|
| 264 |
]
|
| 265 |
|
| 266 |
+
[[package]]
|
| 267 |
+
name = "flash-linear-attention"
|
| 268 |
+
version = "0.5.1"
|
| 269 |
+
source = { registry = "https://pypi.org/simple" }
|
| 270 |
+
dependencies = [
|
| 271 |
+
{ name = "fla-core" },
|
| 272 |
+
{ name = "transformers" },
|
| 273 |
+
]
|
| 274 |
+
sdist = { url = "https://files.pythonhosted.org/packages/4c/e8/8f115be585a046795e4a1f7ade727889219bb66b8d96cc668b8c9e437c0e/flash_linear_attention-0.5.1.tar.gz", hash = "sha256:8840fd4c37de8b0612dc8fd493867f3d330672ba2f17c024a2ce37239634e247", size = 221733, upload-time = "2026-06-18T18:17:16.661Z" }
|
| 275 |
+
wheels = [
|
| 276 |
+
{ url = "https://files.pythonhosted.org/packages/68/3c/5819fb19dc071302ca818616a4e64d4454e1f1193929eb8365c8d38e9052/flash_linear_attention-0.5.1-py3-none-any.whl", hash = "sha256:9022862f0a238752372c81290694b8b2ed1cb2d13fc40d340ffeeb554d6bee5c", size = 403096, upload-time = "2026-06-18T18:17:14.025Z" },
|
| 277 |
]
|
| 278 |
|
| 279 |
[[package]]
|
|
|
|
| 706 |
source = { virtual = "." }
|
| 707 |
dependencies = [
|
| 708 |
{ name = "accelerate" },
|
| 709 |
+
{ name = "flash-linear-attention" },
|
| 710 |
{ name = "gguf" },
|
| 711 |
{ name = "gradio" },
|
| 712 |
{ name = "huggingface-hub" },
|
|
|
|
| 714 |
{ name = "ipython" },
|
| 715 |
{ name = "ipywidgets" },
|
| 716 |
{ name = "openai" },
|
| 717 |
+
{ name = "pillow" },
|
| 718 |
+
{ name = "spaces" },
|
| 719 |
{ name = "torch" },
|
| 720 |
+
{ name = "torchaudio", version = "2.9.1", source = { registry = "https://download.pytorch.org/whl/cu130" }, marker = "platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'" },
|
| 721 |
+
{ name = "torchaudio", version = "2.9.1+cu130", source = { registry = "https://download.pytorch.org/whl/cu130" }, marker = "platform_machine != 'aarch64' or platform_python_implementation != 'CPython' or sys_platform != 'linux'" },
|
| 722 |
+
{ name = "torchvision", version = "0.24.1", source = { registry = "https://download.pytorch.org/whl/cu130" }, marker = "platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'" },
|
| 723 |
+
{ name = "torchvision", version = "0.24.1+cu130", source = { registry = "https://download.pytorch.org/whl/cu130" }, marker = "platform_machine != 'aarch64' or platform_python_implementation != 'CPython' or sys_platform != 'linux'" },
|
| 724 |
{ name = "transformers" },
|
| 725 |
+
{ name = "triton-windows" },
|
| 726 |
]
|
| 727 |
|
| 728 |
[package.dev-dependencies]
|
|
|
|
| 733 |
[package.metadata]
|
| 734 |
requires-dist = [
|
| 735 |
{ name = "accelerate", specifier = ">=1.14.0" },
|
| 736 |
+
{ name = "flash-linear-attention", specifier = ">=0.5.1" },
|
| 737 |
{ name = "gguf", specifier = ">=0.19.0" },
|
| 738 |
{ name = "gradio" },
|
| 739 |
{ name = "huggingface-hub" },
|
|
|
|
| 741 |
{ name = "ipython", specifier = ">=9.15.0" },
|
| 742 |
{ name = "ipywidgets", specifier = ">=8.1.8" },
|
| 743 |
{ name = "openai", specifier = ">=2.46.0" },
|
| 744 |
+
{ name = "pillow", specifier = ">=12.3.0" },
|
| 745 |
+
{ name = "spaces", specifier = ">=0.51.0" },
|
| 746 |
{ name = "torch", specifier = "==2.9.1", index = "https://download.pytorch.org/whl/cu130" },
|
| 747 |
+
{ name = "torchaudio", specifier = "==2.9.1", index = "https://download.pytorch.org/whl/cu130" },
|
| 748 |
+
{ name = "torchvision", index = "https://download.pytorch.org/whl/cu130" },
|
| 749 |
{ name = "transformers" },
|
| 750 |
+
{ name = "triton-windows", specifier = ">=3.5.0.post21" },
|
| 751 |
]
|
| 752 |
|
| 753 |
[package.metadata.requires-dev]
|
|
|
|
| 1385 |
{ url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235, upload-time = "2024-02-25T23:20:01.196Z" },
|
| 1386 |
]
|
| 1387 |
|
| 1388 |
+
[[package]]
|
| 1389 |
+
name = "spaces"
|
| 1390 |
+
version = "0.51.0"
|
| 1391 |
+
source = { registry = "https://pypi.org/simple" }
|
| 1392 |
+
dependencies = [
|
| 1393 |
+
{ name = "gradio" },
|
| 1394 |
+
{ name = "httpx" },
|
| 1395 |
+
{ name = "packaging" },
|
| 1396 |
+
{ name = "pydantic" },
|
| 1397 |
+
{ name = "requests" },
|
| 1398 |
+
{ name = "typing-extensions" },
|
| 1399 |
+
]
|
| 1400 |
+
sdist = { url = "https://files.pythonhosted.org/packages/d0/93/6066dcd0ee4eee2a6242de917b461e6779282cbe78fbf1d278b8042e7232/spaces-0.51.0.tar.gz", hash = "sha256:ff7700969ed3e3500eccae46b9f5f6daf00de182ee2f3ad51156f3ade471fd37", size = 88598, upload-time = "2026-07-10T16:08:46.921Z" }
|
| 1401 |
+
wheels = [
|
| 1402 |
+
{ url = "https://files.pythonhosted.org/packages/a1/ae/77e14929554053c2f5465a555fd0de0b2f26441442b555d677424d4ad0f0/spaces-0.51.0-py3-none-any.whl", hash = "sha256:a6783be3561d2a49a55c23cdbf2f88a1a8d922cf6884ca11a4d70a5ed501d0f6", size = 111642, upload-time = "2026-07-10T16:08:48.011Z" },
|
| 1403 |
+
]
|
| 1404 |
+
|
| 1405 |
[[package]]
|
| 1406 |
name = "stack-data"
|
| 1407 |
version = "0.6.3"
|
|
|
|
| 1511 |
{ url = "https://download-r2.pytorch.org/whl/cu130/torch-2.9.1%2Bcu130-cp312-cp312-win_amd64.whl", hash = "sha256:cd3232a562ad2a2699d48130255e1b24c07dfe694a40dcd24fad683c752de121", upload-time = "2026-01-26T16:37:50Z" },
|
| 1512 |
]
|
| 1513 |
|
| 1514 |
+
[[package]]
|
| 1515 |
+
name = "torchaudio"
|
| 1516 |
+
version = "2.9.1"
|
| 1517 |
+
source = { registry = "https://download.pytorch.org/whl/cu130" }
|
| 1518 |
+
resolution-markers = [
|
| 1519 |
+
"platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
| 1520 |
+
]
|
| 1521 |
+
dependencies = [
|
| 1522 |
+
{ name = "torch", marker = "platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'" },
|
| 1523 |
+
]
|
| 1524 |
+
wheels = [
|
| 1525 |
+
{ url = "https://download-r2.pytorch.org/whl/cu130/torchaudio-2.9.1-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:b3c75f87e325946276c952864dbce2c8fabc88a00d86730c3d5bc0999ebf7789", upload-time = "2025-11-11T19:17:11Z" },
|
| 1526 |
+
]
|
| 1527 |
+
|
| 1528 |
+
[[package]]
|
| 1529 |
+
name = "torchaudio"
|
| 1530 |
+
version = "2.9.1+cu130"
|
| 1531 |
+
source = { registry = "https://download.pytorch.org/whl/cu130" }
|
| 1532 |
+
resolution-markers = [
|
| 1533 |
+
"sys_platform == 'win32'",
|
| 1534 |
+
"sys_platform == 'emscripten'",
|
| 1535 |
+
"(platform_machine != 'aarch64' and sys_platform == 'linux') or (platform_python_implementation != 'CPython' and sys_platform == 'linux') or (sys_platform != 'emscripten' and sys_platform != 'linux' and sys_platform != 'win32')",
|
| 1536 |
+
]
|
| 1537 |
+
dependencies = [
|
| 1538 |
+
{ name = "torch", marker = "platform_machine != 'aarch64' or platform_python_implementation != 'CPython' or sys_platform != 'linux'" },
|
| 1539 |
+
]
|
| 1540 |
+
wheels = [
|
| 1541 |
+
{ url = "https://download-r2.pytorch.org/whl/cu130/torchaudio-2.9.1%2Bcu130-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:a6c58d5e846da5a90d50bd425e2c24368747cd04297d95c6dd51d3f7f85fea26", upload-time = "2025-11-11T19:17:10Z" },
|
| 1542 |
+
{ url = "https://download-r2.pytorch.org/whl/cu130/torchaudio-2.9.1%2Bcu130-cp312-cp312-win_amd64.whl", hash = "sha256:7533a17bed21e5b86b8c49fd79656779779f2c991aef2804af6f318d2022ea6a", upload-time = "2025-11-11T19:17:10Z" },
|
| 1543 |
+
]
|
| 1544 |
+
|
| 1545 |
+
[[package]]
|
| 1546 |
+
name = "torchvision"
|
| 1547 |
+
version = "0.24.1"
|
| 1548 |
+
source = { registry = "https://download.pytorch.org/whl/cu130" }
|
| 1549 |
+
resolution-markers = [
|
| 1550 |
+
"platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
| 1551 |
+
]
|
| 1552 |
+
dependencies = [
|
| 1553 |
+
{ name = "numpy", marker = "platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'" },
|
| 1554 |
+
{ name = "pillow", marker = "platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'" },
|
| 1555 |
+
{ name = "torch", marker = "platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'" },
|
| 1556 |
+
]
|
| 1557 |
+
wheels = [
|
| 1558 |
+
{ url = "https://download-r2.pytorch.org/whl/cu130/torchvision-0.24.1-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:89743dcee13e943f58b37c7647aff14b5bb24c11c84826376d457acf97586fec", upload-time = "2025-11-15T18:12:59Z" },
|
| 1559 |
+
]
|
| 1560 |
+
|
| 1561 |
+
[[package]]
|
| 1562 |
+
name = "torchvision"
|
| 1563 |
+
version = "0.24.1+cu130"
|
| 1564 |
+
source = { registry = "https://download.pytorch.org/whl/cu130" }
|
| 1565 |
+
resolution-markers = [
|
| 1566 |
+
"sys_platform == 'win32'",
|
| 1567 |
+
"sys_platform == 'emscripten'",
|
| 1568 |
+
"(platform_machine != 'aarch64' and sys_platform == 'linux') or (platform_python_implementation != 'CPython' and sys_platform == 'linux') or (sys_platform != 'emscripten' and sys_platform != 'linux' and sys_platform != 'win32')",
|
| 1569 |
+
]
|
| 1570 |
+
dependencies = [
|
| 1571 |
+
{ name = "numpy", marker = "platform_machine != 'aarch64' or platform_python_implementation != 'CPython' or sys_platform != 'linux'" },
|
| 1572 |
+
{ name = "pillow", marker = "platform_machine != 'aarch64' or platform_python_implementation != 'CPython' or sys_platform != 'linux'" },
|
| 1573 |
+
{ name = "torch", marker = "platform_machine != 'aarch64' or platform_python_implementation != 'CPython' or sys_platform != 'linux'" },
|
| 1574 |
+
]
|
| 1575 |
+
wheels = [
|
| 1576 |
+
{ url = "https://download-r2.pytorch.org/whl/cu130/torchvision-0.24.1%2Bcu130-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:6939dd403cc28ab0a46f53e6c86e2e852cf65771c1b0ddd09c44c541a1cdbad9", upload-time = "2025-11-15T18:12:58Z" },
|
| 1577 |
+
{ url = "https://download-r2.pytorch.org/whl/cu130/torchvision-0.24.1%2Bcu130-cp312-cp312-win_amd64.whl", hash = "sha256:d31ceaded0d9b737471fa680ccd9e1acb6d5f0f70f03ef3a8d786a99c79da7cf", upload-time = "2025-11-15T20:02:26Z" },
|
| 1578 |
+
]
|
| 1579 |
+
|
| 1580 |
[[package]]
|
| 1581 |
name = "tornado"
|
| 1582 |
version = "6.5.7"
|
|
|
|
| 1644 |
{ url = "https://files.pythonhosted.org/packages/f2/50/9a8358d3ef58162c0a415d173cfb45b67de60176e1024f71fbc4d24c0b6d/triton-3.5.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d2c6b915a03888ab931a9fd3e55ba36785e1fe70cbea0b40c6ef93b20fc85232", size = 170470207, upload-time = "2025-11-11T17:41:00.253Z" },
|
| 1645 |
]
|
| 1646 |
|
| 1647 |
+
[[package]]
|
| 1648 |
+
name = "triton-windows"
|
| 1649 |
+
version = "3.7.1.post27"
|
| 1650 |
+
source = { registry = "https://pypi.org/simple" }
|
| 1651 |
+
wheels = [
|
| 1652 |
+
{ url = "https://files.pythonhosted.org/packages/76/30/325b420efd0047e119679c646a9a410db216069800ec009fae3da26c69a3/triton_windows-3.7.1.post27-cp312-cp312-win_amd64.whl", hash = "sha256:f5406230d7dbf6965bc4051fcad27b81c39ba4a4bfde06f494dd7ff4eb325a9e", size = 49683004, upload-time = "2026-06-21T16:48:14.02Z" },
|
| 1653 |
+
]
|
| 1654 |
+
|
| 1655 |
[[package]]
|
| 1656 |
name = "typer"
|
| 1657 |
version = "0.27.0"
|