Skip to content

Commit 37176a6

Browse files
authored
Attempting to reduce backtracking. (#48)
* attempting to reduce backtracking. * updated to python 3.9 * formatting & backtracking fix * bumped versions * bumped versions
1 parent c3569fc commit 37176a6

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
python: [3.8]
28+
python: [3.9]
2929
task:
3030
- name: Style
3131
run: |
@@ -48,7 +48,7 @@ jobs:
4848
- uses: actions/checkout@v3
4949

5050
- name: Setup Python
51-
uses: actions/setup-python@v4.5.0
51+
uses: actions/setup-python@v4.4.0
5252
with:
5353
python-version: ${{ matrix.python }}
5454

@@ -75,10 +75,13 @@ jobs:
7575
7676
- name: Setup virtual environment (no cache hit)
7777
if: steps.virtualenv-cache.outputs.cache-hit != 'true'
78+
# we run pip install twice because otherwise we get stuck into
79+
# backtracking for pytorch. if we got for the first install, we
80+
# will automatically get the latest version of pytorch.
7881
run: |
7982
test -d .venv || virtualenv -p $(which python) --copies --reset-app-data .venv
8083
. .venv/bin/activate
81-
pip install -e .[all]
84+
pip install . && rm -rf build && pip install -e .[all]
8285
8386
- name: Setup virtual environment (cache hit)
8487
if: steps.virtualenv-cache.outputs.cache-hit == 'true'

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ requires-python = ">=3.9"
1717
dependencies = [
1818
"torch>=1.9",
1919
"transformers>=4.5",
20-
"necessary>=0.3.1",
21-
"trouting>=0.2.2",
20+
"necessary>=0.3.3",
21+
"trouting>=0.3.3",
2222
"ftfy>=6.1.1",
2323
"platformdirs>=2.5.0",
2424
"glom>=21.0.0",

src/smashed/utils/install_blingfire_macos.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from subprocess import call
44

5-
BASH_SCRIPT = '''
5+
BASH_SCRIPT = """
66
#! /usr/bin/env bash
77
88
# path to the current directory
@@ -35,7 +35,7 @@
3535
# cleanup
3636
cd $CURRENT_DIR
3737
rm -rf $TMP_DIR
38-
'''
38+
"""
3939

4040

4141
def main():

src/smashed/utils/wordsplitter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __call__(
3333
"{module_name} missing. Fix with 'pip install smashed[prompting]'"
3434
"or, if you are on a Mac with Apple Silicon chip, "
3535
"'python -m smashed.utils.install_blingfire_macos'."
36-
)
36+
),
3737
)
3838
class BlingFireSplitter(BaseWordSplitter):
3939
def tokenize(self, text: str) -> List[str]:

0 commit comments

Comments
 (0)