Skip to content

Commit d23867d

Browse files
committed
fx parallel example
1 parent 2043282 commit d23867d

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

examples/parallel_example.ipynb

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"cells": [
33
{
4-
"attachments": {},
54
"cell_type": "markdown",
65
"metadata": {},
76
"source": [
@@ -18,17 +17,19 @@
1817
"SAMPLING_RATE = 16000\n",
1918
"import torch\n",
2019
"from pprint import pprint\n",
20+
"import time\n",
21+
"import shutil\n",
2122
"\n",
2223
"torch.set_num_threads(1)\n",
2324
"NUM_PROCESS=4 # set to the number of CPU cores in the machine\n",
2425
"NUM_COPIES=8\n",
2526
"# download wav files, make multiple copies\n",
26-
"for idx in range(NUM_COPIES):\n",
27-
" torch.hub.download_url_to_file('https://models.silero.ai/vad_models/en.wav', f\"en_example{idx}.wav\")\n"
27+
"torch.hub.download_url_to_file('https://models.silero.ai/vad_models/en.wav', f\"en_example0.wav\")\n",
28+
"for idx in range(NUM_COPIES-1):\n",
29+
" shutil.copy(f\"en_example0.wav\", f\"en_example{idx+1}.wav\")"
2830
]
2931
},
3032
{
31-
"attachments": {},
3233
"cell_type": "markdown",
3334
"metadata": {},
3435
"source": [
@@ -54,7 +55,6 @@
5455
]
5556
},
5657
{
57-
"attachments": {},
5858
"cell_type": "markdown",
5959
"metadata": {},
6060
"source": [
@@ -99,7 +99,6 @@
9999
]
100100
},
101101
{
102-
"attachments": {},
103102
"cell_type": "markdown",
104103
"metadata": {},
105104
"source": [
@@ -127,7 +126,7 @@
127126
],
128127
"metadata": {
129128
"kernelspec": {
130-
"display_name": "diarization",
129+
"display_name": "Python 3 (ipykernel)",
131130
"language": "python",
132131
"name": "python3"
133132
},
@@ -141,7 +140,20 @@
141140
"name": "python",
142141
"nbconvert_exporter": "python",
143142
"pygments_lexer": "ipython3",
144-
"version": "3.9.15"
143+
"version": "3.10.14"
144+
},
145+
"toc": {
146+
"base_numbering": 1,
147+
"nav_menu": {},
148+
"number_sections": true,
149+
"sideBar": true,
150+
"skip_h1_title": false,
151+
"title_cell": "Table of Contents",
152+
"title_sidebar": "Contents",
153+
"toc_cell": false,
154+
"toc_position": {},
155+
"toc_section_display": true,
156+
"toc_window_display": false
145157
}
146158
},
147159
"nbformat": 4,

0 commit comments

Comments
 (0)