ceilf6 commited on
Commit
4c09ddd
ยท
1 Parent(s): a97fe9c

Update v12 q8 subtitle postprocessor

Browse files
Files changed (2) hide show
  1. README.md +21 -6
  2. onnx/model_quantized.onnx +2 -2
README.md CHANGED
@@ -52,9 +52,13 @@ Input payload:
52
  "runtimeOutput": "",
53
  "glossary": ["SubtitlePanel", "postProcessor", "chapters"]
54
  },
55
- "segments": [
56
- { "id": "subtitle-1", "startMs": 0, "endMs": 1600, "text": "่ฟ™้‡Œๅˆ›ๅปบ hugging face ๅญ—ๅน• post processor" },
57
- { "id": "subtitle-2", "startMs": 1600, "endMs": 3300, "text": "ๆœ€ๅŽ็”Ÿๆˆ corrections ๅ’Œ chapters" }
 
 
 
 
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: "webgpu", dtype: "q4f16" },
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
- segments: [{ id: "subtitle-1", startMs: 0, endMs: 1200, text: "่ฟ™้‡Œ็”จ use state" }],
 
104
  }),
105
  },
106
  ];
@@ -112,7 +117,7 @@ const output = await generator(messages, {
112
  });
113
  ```
114
 
115
- In production, code-tape tries WebGPU first and falls back to WASM/CPU-compatible settings when needed. The application also handles browser cache write failures and validates every model response before applying it.
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:50c9b66345eba174d714409c0ffc831b7a1bc6edfc27a67918d06bb077f118bc
3
- size 136587389
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8afda5920b8ce9e352f933602de8500d8665667544bcdad427c4299e8491a4c
3
+ size 221521558