Skip to content

Commit

Permalink
don't fork on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Sep 12, 2022
1 parent ff7dc84 commit 6a8572b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
1 change: 1 addition & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ source:
# backport huggingface/tokenizers#956 (+ dependent commit)
- patches/0001-Fixing-the-documentation-for-ByteLevel-in-Python-982.patch
- patches/0002-Upgrade-pyo3-to-0.16-956.patch
- patches/0003-don-t-fork-on-windows.patch

build:
number: 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 45c48c2aa16d163ad561d50a26cef5f9d5030c88 Mon Sep 17 00:00:00 2001
From 015a738d8548906b7b3bf2561d32a9d7cab5ef8c Mon Sep 17 00:00:00 2001
From: Nicolas Patry <patry.nicolas@protonmail.com>
Date: Thu, 14 Apr 2022 16:29:50 +0200
Subject: [PATCH 1/2] Fixing the documentation for `ByteLevel` in Python (#982)
Subject: [PATCH 1/3] Fixing the documentation for `ByteLevel` in Python (#982)

* Fixing the documentation for `ByteLevel` in Python

Expand Down Expand Up @@ -40,5 +40,5 @@ index 5edc6f2..f858ecf 100644
#[text_signature = "(self, add_prefix_space=True, use_regex=True)"]
pub struct PyByteLevel {}
--
2.35.3.windows.1
2.37.0.windows.1

6 changes: 3 additions & 3 deletions recipe/patches/0002-Upgrade-pyo3-to-0.16-956.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 062cbd1214d3424d2652e3b6115a7df6ef3a2495 Mon Sep 17 00:00:00 2001
From 97ccffc9240765d081085704750fa886e8bba27c Mon Sep 17 00:00:00 2001
From: h-vetinari <h.vetinari@gmx.com>
Date: Fri, 6 May 2022 00:48:40 +1100
Subject: [PATCH 2/2] Upgrade pyo3 to 0.16 (#956)
Subject: [PATCH 2/3] Upgrade pyo3 to 0.16 (#956)

* Upgrade pyo3 to 0.15

Expand Down Expand Up @@ -3357,5 +3357,5 @@ index 8170ffc..9e0d424 100644
pub inner: Regex,
pub pattern: String,
--
2.35.3.windows.1
2.37.0.windows.1

27 changes: 27 additions & 0 deletions recipe/patches/0003-don-t-fork-on-windows.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 6a7f9243809e963a56bae9b3cfd868393742c2ba Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Mon, 12 Sep 2022 14:40:37 +0200
Subject: [PATCH 3/3] don't fork on windows

---
bindings/python/tests/utils.py | 4 ----
1 file changed, 4 deletions(-)

diff --git a/bindings/python/tests/utils.py b/bindings/python/tests/utils.py
index b2b028d..02bfb5b 100644
--- a/bindings/python/tests/utils.py
+++ b/bindings/python/tests/utils.py
@@ -98,10 +98,6 @@ def doc_pipeline_bert_tokenizer(data_dir):
)


-# On MacOS Python 3.8+ the default was modified to `spawn`, we need `fork` in tests.
-mp.set_start_method("fork")
-
-
def multiprocessing_with_parallelism(tokenizer, enabled: bool):
"""
This helper can be used to test that disabling parallelism avoids dead locks when the
--
2.37.0.windows.1

0 comments on commit 6a8572b

Please sign in to comment.