From 179c15edb8c68178f4473d14e38602f26b6c1d26 Mon Sep 17 00:00:00 2001
From: Mateusz Klimaszewski <mk.klimaszewski@gmail.com>
Date: Mon, 18 Jan 2021 12:12:36 +0100
Subject: [PATCH] Fix sentencepiece version per python version.

---
 docs/installation.md | 4 +++-
 setup.py             | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/docs/installation.md b/docs/installation.md
index a4f9193..f6c3fff 100644
--- a/docs/installation.md
+++ b/docs/installation.md
@@ -21,7 +21,9 @@ Run `conda install -c conda-forge jsonnet=0.15.0` and re-run installation.
 
 * No package 'sentencepiece' found
 
-Run `pip install sentencepiece==0.1.83` and re-run installation.
+Run `pip install sentencepiece==0.1.83` for Python < 3.8 and re-run installation.
+
+Run `pip install sentencepiece==0.1.85` for Python >= 3.8 and re-run installation.
 
 * Missing Cython error
 
diff --git a/setup.py b/setup.py
index 89e8208..a66027f 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,8 @@ REQUIREMENTS = [
     'numpy==1.19.4',
     'overrides==3.1.0',
     'requests==2.23.0',
-    'sentencepiece==0.1.83',
+    'sentencepiece==0.1.83;python_version<"3.8"',
+    'sentencepiece==0.1.85;python_version>="3.8"',
     'spacy==2.3.2',
     'scikit-learn<=0.23.2',
     'torch==1.6.0',
-- 
GitLab