Skip to content

Commit 4d69a7c

Browse files
committed
Updated cell outputs
1 parent 78c005e commit 4d69a7c

File tree

1 file changed

+24
-29
lines changed

1 file changed

+24
-29
lines changed

examples/Speech_transcription_methods.ipynb

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
{
4444
"cell_type": "code",
45-
"execution_count": 2,
45+
"execution_count": 1,
4646
"id": "bc940358",
4747
"metadata": {},
4848
"outputs": [],
@@ -71,7 +71,7 @@
7171
},
7272
{
7373
"cell_type": "code",
74-
"execution_count": 7,
74+
"execution_count": 2,
7575
"id": "e4078915",
7676
"metadata": {},
7777
"outputs": [
@@ -168,7 +168,7 @@
168168
},
169169
{
170170
"cell_type": "code",
171-
"execution_count": 2,
171+
"execution_count": 3,
172172
"id": "ab545e4c",
173173
"metadata": {},
174174
"outputs": [
@@ -210,7 +210,7 @@
210210
},
211211
{
212212
"cell_type": "code",
213-
"execution_count": null,
213+
"execution_count": 4,
214214
"id": "7ae4af8d",
215215
"metadata": {},
216216
"outputs": [
@@ -221,7 +221,7 @@
221221
"\n",
222222
"--- TRANSCRIPT ---\n",
223223
"\n",
224-
"And lots of times, you need to give people more than one link at a time. A band could give their fans a couple new videos from a live concert, a behind the scenes photo gallery, an album to purchase, like these next few links.\n",
224+
"And lots of times you need to give people more than one link at a time. A band could give their fans a couple new videos from a live concert, a behind-the-scenes photo gallery, an album to purchase, like these next few links.\n",
225225
"\n"
226226
]
227227
}
@@ -264,16 +264,17 @@
264264
},
265265
{
266266
"cell_type": "code",
267-
"execution_count": 4,
267+
"execution_count": 5,
268268
"id": "d027fdb9",
269269
"metadata": {},
270270
"outputs": [
271271
{
272272
"name": "stdout",
273273
"output_type": "stream",
274274
"text": [
275-
"And lots of times, you need to give people more than one link at a time. A band could give their fans a couple new videos from a live concert, a behind-the-scenes photo gallery, an album to purchase, like these next few links.\n",
276-
"And lots of times, you need to give people more than one link at a time. A band could give their fans a couple new videos from a live concert, a behind-the-scenes photo gallery, an album to purchase, like these next few links.\n"
275+
"And lots of times you need to give people more than one link at a time. A band could give their fans a couple new videos from a live concert, a behind-the-scenes photo gallery, an album to purchase, like these next few links.\n",
276+
"\n",
277+
"And lots of times you need to give people more than one link at a time. A band could give their fans a couple new videos from a live concert, a behind-the-scenes photo gallery, an album to purchase, like these next few links.\n"
277278
]
278279
}
279280
],
@@ -295,6 +296,7 @@
295296
" \n",
296297
" # When transcription is complete, you can get the final transcript using `event.text`\n",
297298
" elif getattr(event, \"text\", None):\n",
299+
" print()\n",
298300
" print(\"\\n\" + event.text)"
299301
]
300302
},
@@ -334,7 +336,7 @@
334336
},
335337
{
336338
"cell_type": "code",
337-
"execution_count": 23,
339+
"execution_count": 8,
338340
"id": "c6fa0ea1",
339341
"metadata": {},
340342
"outputs": [],
@@ -446,24 +448,24 @@
446448
},
447449
{
448450
"cell_type": "code",
449-
"execution_count": 24,
451+
"execution_count": 9,
450452
"id": "d90de5b9",
451453
"metadata": {},
452454
"outputs": [
453455
{
454456
"name": "stdout",
455457
"output_type": "stream",
456458
"text": [
457-
"And lots of times you need to give people more than one link at a time.A band could give theirAn fans album a couple to purchase of new videos from a live concert, a behind-the-scenes photo gallery.Like these next few links."
459+
"And lots of times you need to give people more than one link at a time.A band could give their fans a couple new videos from a live concert, a behind-the-scenes photo galleryLike these next few linksAn album to purchase."
458460
]
459461
},
460462
{
461463
"data": {
462464
"text/plain": [
463-
"'And lots of times you need to give people more than one link at a time. A band could give theirAn fans album a couple to purchase of new videos from a live concert, a behind-the-scenes photo gallery. Like these next few links.'"
465+
"'And lots of times you need to give people more than one link at a time. A band could give their fans a couple new videos from a live concert, a behind-the-scenes photo gallery Like these next few linksAn album to purchase. '"
464466
]
465467
},
466-
"execution_count": 24,
468+
"execution_count": 9,
467469
"metadata": {},
468470
"output_type": "execute_result"
469471
}
@@ -543,7 +545,7 @@
543545
")\n",
544546
"\n",
545547
"# ── 3 · helper to stream ~40 ms chunks at 24 kHz ---------------------------\n",
546-
"def load_and_resample(path: str, sr: int = TARGET_SR) -> np.ndarray:\n",
548+
"def load_and_resample(path: str, sr: int = 24_000) -> np.ndarray:\n",
547549
" \"\"\"Return mono PCM-16 as a NumPy array.\"\"\"\n",
548550
" data, file_sr = sf.read(path, dtype=\"float32\")\n",
549551
" if data.ndim > 1:\n",
@@ -579,7 +581,7 @@
579581
},
580582
{
581583
"cell_type": "code",
582-
"execution_count": 25,
584+
"execution_count": 11,
583585
"id": "611c11e0",
584586
"metadata": {},
585587
"outputs": [
@@ -589,27 +591,20 @@
589591
"text": [
590592
"\n",
591593
"[User]: And lots of times you need to give people more than one link at a time.\n",
592-
"[Assistant]: Et souvent, vous devez donner aux gens plus d'un lien à la fois.\n",
593-
"[User]: A band could give their fans a couple new videos from a live concert, a behind-the-scenes photo gallery,\n",
594-
"[Assistant]: Un groupe pourrait donner à ses fans quelques nouvelles vidéos d'un concert live, une galerie de photos des coulisses,\n",
594+
"[Assistant]: Et souvent, vous devez donner aux gens plusieurs liens à la fois.\n",
595+
"[User]: A band could give their fans a couple new videos from a live concert, a behind-the-scenes photo gallery.\n",
596+
"[Assistant]: Un groupe pourrait donner à ses fans quelques nouvelles vidéos d'un concert live, ainsi qu'une galerie de photos des coulisses.\n",
595597
"[User]: An album to purchase.\n",
596-
"[Assistant]: Un album à acheter."
598+
"[Assistant]: "
597599
]
598600
},
599601
{
600602
"name": "stdout",
601603
"output_type": "stream",
602604
"text": [
603-
"\n",
604-
"[User]: Like these next few links.\n",
605-
"[Assistant]: Comme ces prochains liens."
606-
]
607-
},
608-
{
609-
"name": "stderr",
610-
"output_type": "stream",
611-
"text": [
612-
"Error processing turns: no close frame received or sent\n"
605+
"Un album à acheter.\n",
606+
"[User]: like these next few links.\n",
607+
"[Assistant]: comme ces quelques liens suivants."
613608
]
614609
}
615610
],

0 commit comments

Comments
 (0)