Spaces:
Runtime error
Runtime error
Merge branch 'main' of hf.co:spaces/perler/ppsurf
Browse files
patch
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
diff --git a/src/models/textured_mesh.py b/src/models/textured_mesh.py
|
2 |
-
index 75ffb6d..40d30e6 100644
|
3 |
-
--- a/src/models/textured_mesh.py
|
4 |
-
+++ b/src/models/textured_mesh.py
|
5 |
-
@@ -122,7 +122,7 @@ class TexturedMeshModel(nn.Module):
|
6 |
-
|
7 |
-
self.renderer = Renderer(device=self.device, dim=(render_grid_size, render_grid_size),
|
8 |
-
interpolation_mode=self.opt.texture_interpolation_mode)
|
9 |
-
- self.env_sphere, self.mesh = self.init_meshes()
|
10 |
-
+ self.env_sphere, self.mesh = self.init_meshes(opt.shape_path)
|
11 |
-
self.default_color = [0.8, 0.1, 0.8]
|
12 |
-
self.background_sphere_colors, self.texture_img = self.init_paint()
|
13 |
-
self.meta_texture_img = nn.Parameter(torch.zeros_like(self.texture_img))
|
14 |
-
diff --git a/src/stable_diffusion_depth.py b/src/stable_diffusion_depth.py
|
15 |
-
index 610d2de..e172080 100644
|
16 |
-
--- a/src/stable_diffusion_depth.py
|
17 |
-
+++ b/src/stable_diffusion_depth.py
|
18 |
-
@@ -1,3 +1,5 @@
|
19 |
-
+import os
|
20 |
-
+
|
21 |
-
from diffusers import AutoencoderKL, UNet2DConditionModel, PNDMScheduler
|
22 |
-
from huggingface_hub import hf_hub_download
|
23 |
-
from transformers import CLIPTextModel, CLIPTokenizer, logging
|
24 |
-
@@ -24,9 +26,7 @@ class StableDiffusion(nn.Module):
|
25 |
-
super().__init__()
|
26 |
-
|
27 |
-
try:
|
28 |
-
- with open('./TOKEN', 'r') as f:
|
29 |
-
- self.token = f.read().replace('\n', '') # remove the last \n!
|
30 |
-
- logger.info(f'loaded hugging face access token from ./TOKEN!')
|
31 |
-
+ self.token = os.getenv('HF_TOKEN')
|
32 |
-
except FileNotFoundError as e:
|
33 |
-
self.token = True
|
34 |
-
logger.warning(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|