Commit c001002
authored
[internal] refacto tests for inference snippets (#1287)
This PR does nothing else than updating
`packages/tasks-gen/scripts/generate-snippets-fixtures.ts` which is an
internal script used to test the inference snippets. Goal of this PR is
to store generated snippet under a new file structure like this:
```
./snippets-fixtures/automatic-speech-recognition/python/huggingface_hub/1.hf-inference.py
```
instead of
```
./snippets-fixtures/automatic-speech-recognition/1.huggingface_hub.hf-inference.py
```
In practice the previous file naming was annoying as it meant that
adding a new snippet in a client type could lead to renaming another
file (due to the `0.`, `1.`, ... prefixes).
---
Typically in #1273 it
makes the PR much bigger by e.g. deleting
[`1.openai.hf-inference.py`](https://github.com/huggingface/huggingface.js/pull/1273/files#diff-4759b74a67cc4caa7b2d273d7c2a8015ba062a19a8fad5cb2e227ca935dcb749)
and creating
[`2.openai.hf-inference.py`](https://github.com/huggingface/huggingface.js/pull/1273/files#diff-522e7173f8dd851189bb9b7ff311f4ee78ca65a3994caae803ff4fda5fe59733)
just because a new
[`1.requests.hf-inference.py`](https://github.com/huggingface/huggingface.js/pull/1273/files#diff-c8c5536f5af1631e8f1802155b66b0a23a4316eaaf5fcfce1a036da490acaa22)
has been added.
Separating files by language + client avoid these unnecessary problems.1 parent 1f2d0b6 commit c001002
File tree
70 files changed
+39
-28
lines changed- packages/tasks-gen
- scripts
- snippets-fixtures
- automatic-speech-recognition/python
- huggingface_hub
- requests
- basic-snippet--token-classification/python
- huggingface_hub
- requests
- conversational-llm-non-stream
- js
- huggingface.js
- openai
- python
- huggingface_hub
- openai
- sh/curl
- conversational-llm-stream
- js
- huggingface.js
- openai
- python
- huggingface_hub
- openai
- sh/curl
- conversational-vlm-non-stream
- js
- huggingface.js
- openai
- python
- huggingface_hub
- openai
- sh/curl
- conversational-vlm-stream
- js
- huggingface.js
- openai
- python
- huggingface_hub
- openai
- sh/curl
- document-question-answering/python
- huggingface_hub
- requests
- image-to-image/python
- huggingface_hub
- requests
- tabular/python/requests
- text-classification
- js
- fetch
- huggingface.js
- python
- huggingface_hub
- requests
- sh/curl
- text-to-audio-transformers/python/requests
- text-to-image
- js
- fetch
- huggingface.js
- python
- fal_client
- huggingface_hub
- requests
- sh/curl
- text-to-video
- js/huggingface.js
- python/huggingface_hub
- zero-shot-classification/python/requests
- zero-shot-image-classification/python/requests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
70 files changed
+39
-28
lines changedLines changed: 39 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | | - | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
42 | | - | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | | - | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
65 | | - | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| |||
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
77 | | - | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| |||
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
89 | | - | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
101 | | - | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| |||
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
112 | | - | |
| 114 | + | |
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
| |||
121 | 123 | | |
122 | 124 | | |
123 | 125 | | |
124 | | - | |
| 126 | + | |
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| |||
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
135 | | - | |
| 137 | + | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| |||
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
146 | | - | |
| 148 | + | |
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
| |||
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
157 | | - | |
| 159 | + | |
158 | 160 | | |
159 | 161 | | |
160 | 162 | | |
| |||
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
168 | | - | |
| 170 | + | |
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| |||
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
179 | | - | |
| 181 | + | |
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
| |||
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
190 | | - | |
| 192 | + | |
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
| |||
198 | 200 | | |
199 | 201 | | |
200 | 202 | | |
201 | | - | |
| 203 | + | |
202 | 204 | | |
203 | 205 | | |
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
207 | 209 | | |
208 | | - | |
| 210 | + | |
209 | 211 | | |
210 | 212 | | |
211 | 213 | | |
| |||
228 | 230 | | |
229 | 231 | | |
230 | 232 | | |
231 | | - | |
| 233 | + | |
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
235 | 237 | | |
236 | | - | |
| 238 | + | |
| 239 | + | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
240 | 243 | | |
241 | | - | |
| 244 | + | |
242 | 245 | | |
243 | 246 | | |
244 | 247 | | |
245 | | - | |
| 248 | + | |
| 249 | + | |
246 | 250 | | |
247 | 251 | | |
248 | | - | |
249 | | - | |
250 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
251 | 255 | | |
252 | 256 | | |
253 | 257 | | |
254 | 258 | | |
255 | 259 | | |
256 | 260 | | |
257 | 261 | | |
258 | | - | |
| 262 | + | |
259 | 263 | | |
260 | 264 | | |
261 | 265 | | |
262 | 266 | | |
263 | 267 | | |
264 | 268 | | |
265 | | - | |
266 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
267 | 278 | | |
268 | 279 | | |
269 | 280 | | |
| |||
0 commit comments