Text Generation
Transformers.js
ONNX
Chinese
English
llama
webgpu
wasm
code-tape
subtitle-correction
chapter-generation
conversational
Instructions to use ceilf6/code-tape-subtitle-postprocessor-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use ceilf6/code-tape-subtitle-postprocessor-onnx with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'ceilf6/code-tape-subtitle-postprocessor-onnx');
ceilf6 commited on
Commit ยท
4c09ddd
1
Parent(s): a97fe9c
Update v12 q8 subtitle postprocessor
Browse files- README.md +21 -6
- onnx/model_quantized.onnx +2 -2
README.md
CHANGED
|
@@ -52,9 +52,13 @@ Input payload:
|
|
| 52 |
"runtimeOutput": "",
|
| 53 |
"glossary": ["SubtitlePanel", "postProcessor", "chapters"]
|
| 54 |
},
|
| 55 |
-
"
|
| 56 |
-
{ "id": "subtitle-1", "
|
| 57 |
-
{ "id": "subtitle-2", "
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
]
|
| 59 |
}
|
| 60 |
```
|
|
@@ -83,7 +87,7 @@ import { pipeline } from "@huggingface/transformers";
|
|
| 83 |
const generator = await pipeline(
|
| 84 |
"text-generation",
|
| 85 |
"ceilf6/code-tape-subtitle-postprocessor-onnx",
|
| 86 |
-
{ device: "
|
| 87 |
);
|
| 88 |
|
| 89 |
const messages = [
|
|
@@ -100,7 +104,8 @@ const messages = [
|
|
| 100 |
role: "user",
|
| 101 |
content: JSON.stringify({
|
| 102 |
context: { fileName: "Counter.tsx", code: "", runtimeOutput: "", glossary: ["useState"] },
|
| 103 |
-
|
|
|
|
| 104 |
}),
|
| 105 |
},
|
| 106 |
];
|
|
@@ -112,7 +117,7 @@ const output = await generator(messages, {
|
|
| 112 |
});
|
| 113 |
```
|
| 114 |
|
| 115 |
-
In production, code-tape
|
| 116 |
|
| 117 |
## Integration notes
|
| 118 |
|
|
@@ -138,6 +143,16 @@ code-tape evaluates this model family with project-specific checks:
|
|
| 138 |
|
| 139 |
No broad general-purpose benchmark score is claimed.
|
| 140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
## Limitations
|
| 142 |
|
| 143 |
- The model is small and domain-specific; malformed JSON is possible.
|
|
|
|
| 52 |
"runtimeOutput": "",
|
| 53 |
"glossary": ["SubtitlePanel", "postProcessor", "chapters"]
|
| 54 |
},
|
| 55 |
+
"inputSegments": [
|
| 56 |
+
{ "id": "subtitle-1", "text": "่ฟ้ๅๅปบ hugging face ๅญๅน post processor" },
|
| 57 |
+
{ "id": "subtitle-2", "text": "ๆๅ็ๆ corrections ๅ chapters" }
|
| 58 |
+
],
|
| 59 |
+
"timeline": [
|
| 60 |
+
{ "id": "subtitle-1", "startMs": 0, "endMs": 1600 },
|
| 61 |
+
{ "id": "subtitle-2", "startMs": 1600, "endMs": 3300 }
|
| 62 |
]
|
| 63 |
}
|
| 64 |
```
|
|
|
|
| 87 |
const generator = await pipeline(
|
| 88 |
"text-generation",
|
| 89 |
"ceilf6/code-tape-subtitle-postprocessor-onnx",
|
| 90 |
+
{ device: "wasm", dtype: "q8" },
|
| 91 |
);
|
| 92 |
|
| 93 |
const messages = [
|
|
|
|
| 104 |
role: "user",
|
| 105 |
content: JSON.stringify({
|
| 106 |
context: { fileName: "Counter.tsx", code: "", runtimeOutput: "", glossary: ["useState"] },
|
| 107 |
+
inputSegments: [{ id: "subtitle-1", text: "่ฟ้็จ use state" }],
|
| 108 |
+
timeline: [{ id: "subtitle-1", startMs: 0, endMs: 1200 }],
|
| 109 |
}),
|
| 110 |
},
|
| 111 |
];
|
|
|
|
| 117 |
});
|
| 118 |
```
|
| 119 |
|
| 120 |
+
In production, code-tape loads the validated WASM q8 path directly. The q4/q4f16 exports were not published for the current v12 artifact because local Transformers.js smoke testing produced malformed JSON. The application also handles browser cache write failures and validates every model response before applying it.
|
| 121 |
|
| 122 |
## Integration notes
|
| 123 |
|
|
|
|
| 143 |
|
| 144 |
No broad general-purpose benchmark score is claimed.
|
| 145 |
|
| 146 |
+
## Current v12 smoke result
|
| 147 |
+
|
| 148 |
+
On the code-tape validation prompt with the `inputSegments` plus `timeline` contract:
|
| 149 |
+
|
| 150 |
+
- q8 load: 651 ms;
|
| 151 |
+
- q8 generation: 1274 ms;
|
| 152 |
+
- JSON valid: yes;
|
| 153 |
+
- unknown segment ids: 0;
|
| 154 |
+
- extra timing fields inside `segments`: 0.
|
| 155 |
+
|
| 156 |
## Limitations
|
| 157 |
|
| 158 |
- The model is small and domain-specific; malformed JSON is possible.
|
onnx/model_quantized.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a8afda5920b8ce9e352f933602de8500d8665667544bcdad427c4299e8491a4c
|
| 3 |
+
size 221521558
|