Skip to content

Commit

Permalink
Apply formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerin Philip committed Feb 15, 2022
1 parent 870ba3d commit b4c4f00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
4 changes: 3 additions & 1 deletion bindings/python/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ def modelConfigPath(self, name: str, code: str) -> PathLike:
)

def models(self, name: str, filter_downloaded: bool = True) -> t.List[str]:
return self.repositories.get(name, self.default_repository).models(filter_downloaded)
return self.repositories.get(name, self.default_repository).models(
filter_downloaded
)

def model(self, name: str, model_identifier: str) -> t.Any:
return self.repositories.get(name, self.default_repository).model(
Expand Down
17 changes: 5 additions & 12 deletions bindings/python/test_all.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import pytest

from bergamot import REPOSITORY
from bergamot import ResponseOptions, Service, ServiceConfig, VectorString
from bergamot import REPOSITORY, ResponseOptions, Service, ServiceConfig, VectorString


def test_basic():
keys = ['browsermt']
config = ServiceConfig(numWorkers=1, logLevel='critical')
keys = ["browsermt"]
config = ServiceConfig(numWorkers=1, logLevel="critical")
service = Service(config)
for repository in keys:
models = REPOSITORY.models(repository, filter_downloaded=False)
Expand All @@ -16,9 +14,7 @@ def test_basic():
for modelId in models:
configPath = REPOSITORY.modelConfigPath(repository, modelId)
model = service.modelFromConfigPath(configPath)
options = ResponseOptions(
alignment=True, qualityScores=True, HTML=False
)
options = ResponseOptions(alignment=True, qualityScores=True, HTML=False)
print(repository, modelId)
source = "1 2 3 4 5 6 7 8 9"
responses = service.translate(model, VectorString([source]), options)
Expand All @@ -28,8 +24,5 @@ def test_basic():
print()





if __name__ == '__main__':
if __name__ == "__main__":
test_basic()

0 comments on commit b4c4f00

Please sign in to comment.