Skip to content

Commit

Permalink
made small fixes to files and run black and isort
Browse files Browse the repository at this point in the history
  • Loading branch information
Alphonsce committed May 9, 2024
1 parent 4305dac commit 68d1607
Show file tree
Hide file tree
Showing 129 changed files with 7,494 additions and 6,746 deletions.
21 changes: 3 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
from distutils.core import Command

from setuptools import find_packages, setup


# IMPORTANT:
# 1. all dependencies should be listed here with their version requirements if any
# 2. once modified, run: `make deps_table_update` to update src/tree-ring-watermark/dependency_versions_table.py
_deps = [
# "torch==1.13.0",
"transformers==4.31.0",
"diffusers==0.14.0",
# "torch==1.13.0",
"transformers==4.31.0",
"diffusers==0.14.0",
]

# this is a lookup table with items like:
Expand Down Expand Up @@ -108,12 +96,10 @@ def run(self):
package_dir={"": "src"},
packages=find_packages("src"),
include_package_data=True,

package_data={
# 'tree_ring_watermark': ['src/tree_ring_watermark/open_clip/bpe_simple_vocab_16e6.txt.gz', 'src/tree_ring_watermark/open_clip/model_configs/*.json']
"": ["*.gz", "*.json", "*.pth"]
},

python_requires=">=3.7.0",
install_requires=install_requires,
extras_require=extras,
Expand Down Expand Up @@ -152,4 +138,3 @@ def run(self):
# twine upload dist/* -r pypi
# 8. Add release notes to the tag in github once everything is looking hunky-dory.
# 9. Update the version in __init__.py, setup.py to the new version "-dev" and push to master

38 changes: 19 additions & 19 deletions src/metr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# I call it a 0.1.0 version
import sys
import os
import sys

sys.path.append(os.path.dirname(os.path.abspath(__file__)))

__version__ = "0.1.0"

from ._check import check
from ._detect import detect
from ._get_noise import get_noise
from .utils import set_org, get_org

from .modified_stable_diffusion import ModifiedStableDiffusionPipeline
from .inverse_stable_diffusion import InversableStableDiffusionPipeline

from .optim_utils import *
from .io_utils import *

# To run run_tree_watermarking scripts:
from .open_clip import create_model, create_model_and_transforms, create_model_from_pretrained, get_tokenizer, create_loss
from .pytorch_fid.fid_score import *
from .guided_diffusion.script_util import (
NUM_CLASSES,
model_and_diffusion_defaults,
create_model_and_diffusion,
add_dict_to_argparser,
args_to_dict,
)
create_model_and_diffusion,
model_and_diffusion_defaults,
)
from .inverse_stable_diffusion import InversableStableDiffusionPipeline
from .io_utils import *
from .modified_stable_diffusion import ModifiedStableDiffusionPipeline

# To run metr scripts:
from .open_clip import (
create_loss,
create_model,
create_model_and_transforms,
create_model_from_pretrained,
get_tokenizer,
)
from .optim_utils import *
from .pytorch_fid.fid_score import *
from .utils import get_org, set_org
4 changes: 0 additions & 4 deletions src/metr/_check.py

This file was deleted.

90 changes: 0 additions & 90 deletions src/metr/_detect.py

This file was deleted.

94 changes: 0 additions & 94 deletions src/metr/_get_noise.py

This file was deleted.

Loading

0 comments on commit 68d1607

Please sign in to comment.