Skip to content

Commit fb75479

Browse files
authored
update deps (rom1504#336)
* update deps * update pex * better deps * deps * revert torch update * update torch dep * torch
1 parent b3f3ac4 commit fb75479

File tree

8 files changed

+20
-78
lines changed

8 files changed

+20
-78
lines changed

Diff for: .pylintrc

-63
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
# pygtk.require().
88
#init-hook=
99

10-
# Profiled execution.
11-
profile=no
12-
1310
# Add files or directories to the blacklist. They should be base names, not
1411
# paths.
1512
ignore=CVS
@@ -41,22 +38,13 @@ enable=indexing-exception,old-raise-syntax
4138
disable=design,similarities,no-self-use,attribute-defined-outside-init,locally-disabled,star-args,pointless-except,bad-option-value,global-statement,fixme,suppressed-message,useless-suppression,locally-enabled,no-member,no-name-in-module,import-error,unsubscriptable-object,unbalanced-tuple-unpacking,undefined-variable,not-context-manager,no-else-return,wrong-import-order,unnecessary-pass,logging-fstring-interpolation,logging-format-interpolation,C0330
4239

4340

44-
# Set the cache size for astng objects.
45-
cache-size=500
46-
47-
4841
[REPORTS]
4942

5043
# Set the output format. Available formats are text, parseable, colorized, msvs
5144
# (visual studio) and html. You can also give a reporter class, eg
5245
# mypackage.mymodule.MyReporterClass.
5346
output-format=text
5447

55-
# Put messages in a separate file for each module / package specified on the
56-
# command line instead of printing them on stdout. Reports (if any) will be
57-
# written in a file name "pylint_global.[txt|html]".
58-
files-output=no
59-
6048
# Tells whether to display a full report or only the messages
6149
reports=no
6250

@@ -67,10 +55,6 @@ reports=no
6755
# (RP0004).
6856
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
6957

70-
# Add a comment according to your evaluation note. This is used by the global
71-
# evaluation report (RP0004).
72-
comment=no
73-
7458
# Template used to display messages. This is a python new-style format string
7559
# used to format the message information. See doc for all details
7660
#msg-template=
@@ -86,10 +70,6 @@ ignore-mixin-members=yes
8670
# (useful for classes with attributes dynamically set).
8771
ignored-classes=SQLObject
8872

89-
# When zope mode is activated, add a predefined set of Zope acquired attributes
90-
# to generated-members.
91-
zope=no
92-
9373
# List of members which are set dynamically and missed by pylint inference
9474
# system, and so shouldn't trigger E0201 when accessed. Python regular
9575
# expressions are accepted.
@@ -116,17 +96,6 @@ additional-builtins=
11696

11797
[BASIC]
11898

119-
# Required attributes for module, separated by a comma
120-
required-attributes=
121-
122-
# List of builtins function names that should not be used, separated by a comma
123-
bad-functions=apply,input,reduce
124-
125-
126-
# Disable the report(s) with the given id(s).
127-
# All non-Google reports are disabled by default.
128-
disable-report=R0001,R0002,R0003,R0004,R0101,R0102,R0201,R0202,R0220,R0401,R0402,R0701,R0801,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R0921,R0922,R0923
129-
13099
# Regular expression which should only match correct module names
131100
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
132101

@@ -196,9 +165,6 @@ ignore-long-lines=(?x)
196165
# else.
197166
single-line-if-stmt=y
198167

199-
# List of optional constructs for which whitespace checking is disabled
200-
no-space-check=
201-
202168
# Maximum number of lines in a module
203169
max-module-lines=99999
204170

@@ -250,10 +216,6 @@ extension-pkg-whitelist=_jsonnet
250216

251217
[CLASSES]
252218

253-
# List of interface methods to ignore, separated by a comma. This is used for
254-
# instance to not check methods defines in Zope's Interface base class.
255-
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
256-
257219
# List of method names used to declare (i.e. assign) instance attributes.
258220
defining-attr-methods=__init__,__new__,setUp
259221

@@ -298,31 +260,6 @@ min-public-methods=2
298260
max-public-methods=20
299261

300262

301-
[EXCEPTIONS]
302-
303-
# Exceptions that will emit a warning when being caught. Defaults to
304-
# "Exception"
305-
overgeneral-exceptions=Exception,StandardError,BaseException
306-
307-
308-
[AST]
309-
310-
# Maximum line length for lambdas
311-
short-func-length=1
312-
313-
# List of module members that should be marked as deprecated.
314-
# All of the string functions are listed in 4.1.4 Deprecated string functions
315-
# in the Python 2.4 docs.
316-
deprecated-members=string.atof,string.atoi,string.atol,string.capitalize,string.expandtabs,string.find,string.rfind,string.index,string.rindex,string.count,string.lower,string.split,string.rsplit,string.splitfields,string.join,string.joinfields,string.lstrip,string.rstrip,string.strip,string.swapcase,string.translate,string.upper,string.ljust,string.rjust,string.center,string.zfill,string.replace,sys.exitfunc
317-
318-
319-
[DOCSTRING]
320-
321-
# List of exceptions that do not need to be mentioned in the Raises section of
322-
# a docstring.
323-
ignore-exceptions=AssertionError,NotImplementedError,StopIteration,TypeError
324-
325-
326263

327264
[TOKENS]
328265

Diff for: Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ black: ## [Local development] Auto-format python code using black
1616
build-pex:
1717
python3 -m venv .pexing
1818
. .pexing/bin/activate && python -m pip install -U pip && python -m pip install pex
19-
. .pexing/bin/activate && python -m pex --layout packed -f https://download.pytorch.org/whl/cu113/torch_stable.html setuptools gcsfs charset-normalizer==2.1.1 s3fs pyspark==3.2.0 torch==1.10.2+cu113 torchvision==0.11.3+cu113 . -o clip_retrieval.pex -v
19+
. .pexing/bin/activate && python -m pex --layout packed -f https://download.pytorch.org/whl/cu113/torch_stable.html setuptools gcsfs charset-normalizer s3fs pyspark torch==1.10.2+cu113 torchvision==0.11.3+cu113 . -o clip_retrieval.pex -v
2020
rm -rf .pexing
21-
tar czf clip_retrieval_torch.tgz clip_retrieval.pex/.deps/torch-1.10.2+cu113-cp38-cp38-linux_x86_64.whl
22-
tar czf clip_retrieval.tgz --exclude clip_retrieval.pex/.deps/torch-1.10.2+cu113-cp38-cp38-linux_x86_64.whl clip_retrieval.pex
21+
tar czf clip_retrieval_torch.tgz clip_retrieval.pex/.deps/torch-*
22+
tar czf clip_retrieval.tgz --exclude clip_retrieval.pex/.deps/torch-* clip_retrieval.pex
2323

2424
venv-lint-test: ## [Continuous integration]
2525
python3 -m venv .env && . .env/bin/activate && make install install-dev lint test && rm -rf .env

Diff for: clip_retrieval/clip_client.py

+1
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,5 @@ def __search_knn_api__(
149149
"num_result_ids": self.num_images,
150150
}
151151
),
152+
timeout=3600,
152153
).json()

Diff for: clip_retrieval/clip_inference/reader.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ def folder_to_keys(folder, enable_text=True, enable_image=True, enable_metadata=
3535
metadata_files = {metadata_file.relative_to(path).as_posix(): metadata_file for metadata_file in metadata_files}
3636

3737
keys = None
38-
join = lambda new_set: new_set & keys if keys is not None else new_set
38+
39+
def join(new_set):
40+
return new_set & keys if keys is not None else new_set
41+
3942
if enable_text:
4043
keys = join(text_files.keys())
4144
elif enable_image:
@@ -137,7 +140,9 @@ def create_webdataset(
137140
urls = input_sampler(urls)
138141

139142
dataset = wds.WebDataset(urls, cache_dir=cache_path, cache_size=10**10, handler=wds.handlers.warn_and_continue)
140-
tokenizer = lambda text: clip.tokenize([text], truncate=True)[0]
143+
144+
def tokenizer(text):
145+
return clip.tokenize([text], truncate=True)[0]
141146

142147
def filter_dataset(item):
143148
if enable_text and caption_key not in item:

Diff for: requirements-test.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
img2dataset
2-
black==22.3.0
2+
black==23.12.1
33
mypy==1.8.0
4-
pylint==2.13.4
4+
pylint==3.0.3
55
pytest-cov==4.1.0
6-
pytest-xdist==2.5.0
6+
pytest-xdist==3.5.0
77
pytest==7.4.4
88
types-setuptools
99
types-requests

Diff for: requirements.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ torch>=1.7.1,<2
66
torchvision>=0.10.1,<2
77
numpy>=1.19.5,<2
88
faiss-cpu>=1.7.2,<2
9-
flask>=2.0.3,<3
9+
flask>=3.0.0,<4
1010
flask_restful>=0.3.9,<1
11-
flask_cors>=3.0.10,<4
11+
flask_cors>=4.0.0,<5
1212
pandas>=1.1.5,<2
13-
pyarrow>=6.0.1,<8
13+
pyarrow>=6.0.1,<13
1414
autofaiss>=2.9.6,<3
1515
webdataset>=0.2,<0.3
1616
h5py>=3.1.0,<4
1717
prometheus-client>=0.13.1,<1
1818
fsspec
1919
sentence-transformers>=2.2.0,<3
20-
wandb>=0.12.10,<0.13
20+
wandb>=0.12.0,<0.17
2121
open-clip-torch>=2.0.0,<3.0.0
2222
requests>=2.27.1,<3
2323
aiohttp>=3.8.1,<4
2424
multilingual-clip>=1.0.10,<2
2525
transformers
2626
urllib3<2
27-
scipy<1.11.5
27+
scipy<1.12
2828
all_clip<2

Diff for: setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def package_files(directory):
1212
paths = []
13-
for (path, _, filenames) in os.walk(directory):
13+
for path, _, filenames in os.walk(directory):
1414
for filename in filenames:
1515
paths.append(os.path.join("..", path, filename))
1616
return paths

Diff for: tests/test_clip_inference/test_worker.py

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ def test_worker():
1111
input_dataset = os.path.join(current_folder, "test_images")
1212

1313
with tempfile.TemporaryDirectory() as tmpdir:
14-
1514
worker(
1615
tasks=[0, 1],
1716
input_dataset=input_dataset,

0 commit comments

Comments
 (0)