Skip to content

Commit

Permalink
Upgrade Python Version to 3.7 (compatible with Colab)
Browse files Browse the repository at this point in the history
  • Loading branch information
rolczynski committed Aug 1, 2021
1 parent 8b7fde1 commit 408f45f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ git clone [email protected]:ScalaConsultants/Aspect-Based-Sentiment-Analysis.git
conda env create -f=environment.yml
conda activate Aspect-Based-Sentiment-Analysis
```
The package works with the Python in the version 3.7 (the same as in Colab 2021).

<br>

Expand Down
6 changes: 3 additions & 3 deletions aspect_based_sentiment_analysis/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import numpy as np

import transformers
from transformers.modeling_tf_utils import TFModelInputType
import tensorflow as tf
from tensorflow.keras import layers
from transformers.modeling_tf_utils import TFModelInputType

logger = logging.getLogger('absa.model')

Expand Down Expand Up @@ -56,7 +56,7 @@ class ABSClassifier(tf.keras.Model, ABC):
@abstractmethod
def call(
self,
token_ids: tf.Tensor,
input_ids: tf.Tensor,
attention_mask: tf.Tensor = None,
token_type_ids: tf.Tensor = None,
training: bool = False,
Expand All @@ -70,7 +70,7 @@ def call(
Parameters
----------
token_ids
input_ids
Indices of input sequence subtokens in the vocabulary.
attention_mask
Bool mask used to avoid performing attention on padding token
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Aspect-Based-Sentiment-Analysis
dependencies:
- python=3.6.9
- python=3.7
- scikit-learn=0.24.2
- pytest=6.2.4
- pytest-timeout=1.4.2
- ipython=7.3
- spacy=3.1.0
- dataclasses=0.8
- pip:
- tensorflow==2.5.0
- google-cloud-storage==1.40.0
- testfixtures==6.17.1
- transformers==4.8.2
- optuna==2.8.0
- spacy==3.1.1
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
include_package_data=False,
packages=find_packages(),
install_requires=[
'tensorflow==2.5.0',
'transformers==4.8.2',
'tensorflow==2.5',
'transformers==4.8',
'pytest',
'scikit-learn',
'ipython',
Expand All @@ -34,5 +34,5 @@
'optuna',
'spacy'
],
python_requires='>=3.6.9',
python_requires='==3.7.*',
)

0 comments on commit 408f45f

Please sign in to comment.