Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
combo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Syntactic Tools
combo
Commits
0f4a10dd
Commit
0f4a10dd
authored
Nov 11, 2023
by
Maja Jablonska
Browse files
Options
Downloads
Patches
Plain Diff
download.py fixes to URLs
parent
8ed20add
No related branches found
No related tags found
1 merge request
!46
Merge COMBO 3.0 into master
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
combo/predict.py
+5
-4
5 additions, 4 deletions
combo/predict.py
combo/utils/download.py
+7
-10
7 additions, 10 deletions
combo/utils/download.py
with
12 additions
and
14 deletions
combo/predict.py
+
5
−
4
View file @
0f4a10dd
...
...
@@ -7,7 +7,7 @@ import numpy as np
import
torch
from
overrides
import
overrides
from
combo
import
data
,
models
from
combo
import
data
from
combo.common
import
util
from
combo.config
import
Registry
from
combo.config.from_parameters
import
register_arguments
...
...
@@ -16,9 +16,10 @@ from combo.data.dataset_loaders.dataset_loader import TensorDict
from
combo.data.dataset_readers.dataset_reader
import
DatasetReader
from
combo.data.instance
import
JsonDict
from
combo.default_model
import
default_ud_dataset_reader
from
combo.modules.archival
import
load_archive
from
combo.predictors
import
PredictorModule
from
combo.utils
import
download
,
graph
from
modules.model
import
Model
from
combo.
modules.model
import
Model
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -244,7 +245,7 @@ class COMBO(PredictorModule):
return
tree
,
predictions
[
"
sentence_embedding
"
],
embeddings
@classmethod
def
with_spacy_tokenizer
(
cls
,
model
:
models
.
Model
,
def
with_spacy_tokenizer
(
cls
,
model
:
Model
,
dataset_reader
:
DatasetReader
):
return
cls
(
model
,
dataset_reader
,
tokenizers
.
SpacyTokenizer
())
...
...
@@ -262,7 +263,7 @@ class COMBO(PredictorModule):
logger
.
error
(
e
)
raise
e
archive
=
models
.
load_archive
(
model_path
,
cuda_device
=
cuda_device
)
archive
=
load_archive
(
model_path
,
cuda_device
=
cuda_device
)
model
=
archive
.
model
dataset_reader
=
default_ud_dataset_reader
()
return
cls
(
model
,
dataset_reader
,
tokenizer
,
batch_size
)
This diff is collapsed.
Click to expand it.
combo/utils/download.py
+
7
−
10
View file @
0f4a10dd
...
...
@@ -10,12 +10,9 @@ from requests import adapters, exceptions
logger
=
logging
.
getLogger
(
__name__
)
DATA_TO_PATH
=
{
"
enhanced
"
:
"
iwpt_2020
"
,
"
iwpt2021
"
:
"
iwpt_2021
"
,
"
ud25
"
:
"
ud_25
"
,
"
ud27
"
:
"
ud_27
"
,
"
ud29
"
:
"
ud_29
"
}
_PROTOTYPE_URL
=
"
http://s3.clarin-pl.eu/dspace/combo/prototype/{model}.tar.gz
"
"
prototype
"
:
"
prototype
"
,
"
ud213
"
:
"
ud_213
"
}
_URL
=
"
http://s3.clarin-pl.eu/dspace/combo/{data}/{model}.tar.gz
"
_HOME_DIR
=
os
.
getenv
(
"
HOME
"
,
os
.
curdir
)
_CACHE_DIR
=
os
.
getenv
(
"
COMBO_DIR
"
,
os
.
path
.
join
(
_HOME_DIR
,
"
.combo
"
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment