Bobby commited on
Commit
4b55d78
·
1 Parent(s): 2abf205

testing jit

Browse files
Dockerfile CHANGED
@@ -33,13 +33,13 @@ ENV HOME=/home/user \
33
 
34
  RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
35
 
 
 
 
36
  # Set the working directory to the user's home directory
37
  WORKDIR $HOME/app
38
 
39
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
40
  COPY --chown=user . $HOME/app
41
 
42
- CMD ["python3", "anime_app.py"]
43
-
44
- RUN apt-get install -y nvidia-340
45
- RUN nvidia-smi
 
33
 
34
  RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
35
 
36
+ RUN apt-get install -y nvidia-340
37
+ RUN nvidia-smi
38
+
39
  # Set the working directory to the user's home directory
40
  WORKDIR $HOME/app
41
 
42
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
43
  COPY --chown=user . $HOME/app
44
 
45
+ CMD ["python3", "anime_app.py"]
 
 
 
controlnet_aux/normalbae/nets/submodules/efficientnet_repo/geffnet/activations/activations_me.py CHANGED
@@ -18,7 +18,7 @@ __all__ = ['swish_me', 'SwishMe', 'mish_me', 'MishMe',
18
  'hard_sigmoid_me', 'HardSigmoidMe', 'hard_swish_me', 'HardSwishMe']
19
 
20
 
21
- # @torch.jit.script
22
  def swish_jit_fwd(x):
23
  return x.mul(torch.sigmoid(x))
24
 
 
18
  'hard_sigmoid_me', 'HardSigmoidMe', 'hard_swish_me', 'HardSwishMe']
19
 
20
 
21
+ @torch.jit.script
22
  def swish_jit_fwd(x):
23
  return x.mul(torch.sigmoid(x))
24
 
test DELETED
@@ -1,90 +0,0 @@
1
- Spaces
2
- Hugging Face's logo
3
-
4
- broyang
5
- /
6
- anime-ai
7
-
8
-
9
- like
10
- 4
11
-
12
- Logs
13
- App
14
- Files
15
- Community
16
- Settings
17
-
18
-
19
- Logs
20
-
21
- Build
22
- Container
23
- Lock scroll
24
-
25
- Clear
26
-
27
-
28
- ===== Application Startup at 2024-05-21 21:14:15 =====
29
-
30
- The cache for model files in Transformers v4.22.0 has been updated. Migrating your old cache. This is a one-time only operation. You can interrupt this and resume the migration later on by calling `transformers.utils.move_cache()`.
31
-
32
- 0it [00:00, ?it/s]
33
- 0it [00:00, ?it/s]
34
- CUDA version: 12.1
35
- loading pipe
36
- initializing controlnet
37
- Some weights of the model checkpoint were not used when initializing CLIPTextModel:
38
- ['text_model.embeddings.position_ids']
39
- You have disabled the safety checker for <class 'diffusers.pipelines.controlnet.pipeline_controlnet.StableDiffusionControlNetPipeline'> by passing `safety_checker=None`. Ensure that you abide to the conditions of the Stable Diffusion license and do not expose unfiltered results in services or applications open to the public. Both the diffusers team and Hugging Face strongly recommend to keep the safety filter enabled in all public facing circumstances, disabling it only for use-cases that involve analyzing network behavior or auditing its results. For more information, please have a look at https://github.com/huggingface/diffusers/pull/254 .
40
- Traceback (most recent call last):
41
- File "/home/user/app/anime_app.py", line 79, in <module>
42
- preprocessor.load("NormalBae")
43
- File "/home/user/app/preprocess_anime.py", line 22, in load
44
- self.model = NormalBaeDetector.from_pretrained(self.MODEL_ID).to("cuda")
45
- File "/home/user/app/controlnet_aux/normalbae/__init__.py", line 52, in from_pretrained
46
- model = NNET(args)
47
- File "/home/user/app/controlnet_aux/normalbae/nets/NNET.py", line 12, in __init__
48
- self.encoder = Encoder()
49
- File "/home/user/app/controlnet_aux/normalbae/nets/submodules/encoder.py", line 14, in __init__
50
- basemodel = torch.hub.load(repo_path, basemodel_name, pretrained=False, source='local')
51
- File "/usr/local/lib/python3.10/site-packages/torch/hub.py", line 566, in load
52
- model = _load_local(repo_or_dir, model, *args, **kwargs)
53
- File "/usr/local/lib/python3.10/site-packages/torch/hub.py", line 592, in _load_local
54
- hub_module = _import_module(MODULE_HUBCONF, hubconf_path)
55
- File "/usr/local/lib/python3.10/site-packages/torch/hub.py", line 106, in _import_module
56
- spec.loader.exec_module(module)
57
- File "<frozen importlib._bootstrap_external>", line 883, in exec_module
58
- File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
59
- File "/home/user/app/controlnet_aux/normalbae/nets/submodules/efficientnet_repo/hubconf.py", line 3, in <module>
60
- from geffnet import efficientnet_b0
61
- File "/home/user/app/controlnet_aux/normalbae/nets/submodules/efficientnet_repo/geffnet/__init__.py", line 1, in <module>
62
- from .gen_efficientnet import *
63
- File "/home/user/app/controlnet_aux/normalbae/nets/submodules/efficientnet_repo/geffnet/gen_efficientnet.py", line 35, in <module>
64
- from .efficientnet_builder import *
65
- File "/home/user/app/controlnet_aux/normalbae/nets/submodules/efficientnet_repo/geffnet/efficientnet_builder.py", line 9, in <module>
66
- from geffnet.activations import *
67
- File "/home/user/app/controlnet_aux/normalbae/nets/submodules/efficientnet_repo/geffnet/activations/__init__.py", line 2, in <module>
68
- from geffnet.activations.activations_me import *
69
- File "/home/user/app/controlnet_aux/normalbae/nets/submodules/efficientnet_repo/geffnet/activations/activations_me.py", line 146, in <module>
70
- def hard_swish_jit_bwd(x, grad_output):
71
- File "/usr/local/lib/python3.10/site-packages/torch/jit/_script.py", line 1395, in script
72
- fn = torch._C._jit_script_compile(
73
- File "/usr/local/lib/python3.10/site-packages/torch/jit/annotations.py", line 115, in get_signature
74
- signature = try_real_annotations(fn, loc)
75
- File "/usr/local/lib/python3.10/site-packages/torch/jit/annotations.py", line 345, in try_real_annotations
76
- arg_types = [ann_to_type(p.annotation, loc) for p in sig.parameters.values()]
77
- File "/usr/local/lib/python3.10/site-packages/torch/jit/annotations.py", line 345, in <listcomp>
78
- arg_types = [ann_to_type(p.annotation, loc) for p in sig.parameters.values()]
79
- File "/usr/local/lib/python3.10/site-packages/torch/jit/annotations.py", line 513, in ann_to_type
80
- raise ValueError(f"Unknown type annotation: '{ann}' at {loc.highlight()}")
81
- ValueError: Unknown type annotation: 'Any' at File "/home/user/app/controlnet_aux/normalbae/nets/submodules/efficientnet_repo/geffnet/activations/activations_me.py", line 147
82
- @torch.jit.script
83
- def hard_swish_jit_bwd(x, grad_output):
84
- m = torch.ones_like(x) * (x >= 3.)
85
- ~~~~~~~~~~~~~~~ <--- HERE
86
- m = torch.where((x >= -3.) & (x <= 3.), x / 3. + .5, m)
87
- return grad_output * m
88
-
89
- Loading base model ()...
90
- Building...