Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce gh-actions diskspace #3327

Merged
merged 8 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install Torch cpu
run: pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Install Flair dependencies
run: pip install -e .
- name: Install unittest dependencies
Expand All @@ -31,4 +33,4 @@ jobs:
- name: Run tests
run: |
python -c 'import flair'
pytest --runintegration --durations=0 -vv
pytest --runintegration -vv
2 changes: 1 addition & 1 deletion .github/workflows/issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: issue_comment
jobs:
issue_commented:
name: Issue comment
if: ${{ !github.event.issue.pull_request && github.event.issue.author == github.even.issue_comment.author }}
if: ${{ github.event.issue.pull_request && github.event.issue.author == github.even.issue_comment.author }}
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-remove-labels@v1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
- name: Install Torch cpu
run: pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Install Flair dependencies
run: pip install -e .
- name: Install unittest dependencies
Expand Down
1 change: 0 additions & 1 deletion flair/datasets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ def __init__(
log.warning('ATTENTION! The library "pymongo" is not installed!')
log.warning('To use MongoDataset, please first install with "pip install pymongo"')
log.warning("-" * 100)
pass

self.in_memory = in_memory
self.tokenizer = tokenizer
Expand Down
1 change: 0 additions & 1 deletion flair/datasets/biomedical.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ def filter_and_map_entities(
new_entities.append(new_entity)
else:
logging.debug(f"Skip entity type {entity.type}")
pass
mapped_entities_per_document[id] = new_entities

return InternalBioNerDataset(documents=dataset.documents, entities_per_document=mapped_entities_per_document)
Expand Down
1 change: 0 additions & 1 deletion flair/embeddings/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ def __init__(
log.warning('ATTENTION! The library "sentence-transformers" is not installed!')
log.warning('To use Sentence Transformers, please first install with "pip install sentence-transformers"')
log.warning("-" * 100)
pass

self.model_name = model
self.model = SentenceTransformer(
Expand Down
3 changes: 1 addition & 2 deletions flair/embeddings/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def embedding_type(self) -> str:

def to_params(self) -> Dict[str, Any]:
# legacy pickle-like saving for image embeddings, as implementation details are not obvious
return self.__getstate__() # type: ignore[operator]
return self.__getstate__()

@classmethod
def from_params(cls, params: Dict[str, Any]) -> "Embeddings":
Expand Down Expand Up @@ -104,7 +104,6 @@ def __init__(self, name, pretrained=True, transforms=None) -> None:
log.warning('ATTENTION! The library "torchvision" is not installed!')
log.warning('To use convnets pretraned on ImageNet, please first install with "pip install torchvision"')
log.warning("-" * 100)
pass

model_info = {
"resnet50": (torchvision.models.resnet50, lambda x: list(x)[:-1], 2048),
Expand Down
1 change: 0 additions & 1 deletion flair/embeddings/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def __init__(
log.warning('ATTENTION! The library "allennlp" is not installed!')
log.warning('To use ELMoEmbeddings, please first install with "pip install allennlp==0.9.0"')
log.warning("-" * 100)
pass

assert embedding_mode in ["all", "top", "average"]

Expand Down
2 changes: 1 addition & 1 deletion flair/optim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch
from torch.optim import Optimizer
from torch.optim.lr_scheduler import LambdaLR, ReduceLROnPlateau, _LRScheduler
from torch.optim.optimizer import required # type: ignore[attr-defined]
from torch.optim.optimizer import required

log = logging.getLogger("flair")

Expand Down