Spaces:
Build error
Build error
Nupur Kumari
commited on
Commit
·
114e9fc
1
Parent(s):
5d9a480
custom-diffusion-space
Browse files- inference.py +2 -2
inference.py
CHANGED
@@ -10,9 +10,8 @@ import numpy as np
|
|
10 |
|
11 |
import torch
|
12 |
from diffusers import StableDiffusionPipeline
|
13 |
-
sys.path.insert(0, 'custom-diffusion')
|
14 |
|
15 |
-
from src import diffuser_training
|
16 |
|
17 |
# def load_model(text_encoder, tokenizer, unet, save_path, modifier_token, freeze_model='crossattn_kv'):
|
18 |
# st = torch.load(save_path)
|
@@ -68,6 +67,7 @@ class InferencePipeline:
|
|
68 |
model_id, torch_dtype=torch.float16)
|
69 |
pipe = pipe.to(self.device)
|
70 |
|
|
|
71 |
diffuser_training.load_model(pipe.text_encoder, pipe.tokenizer, pipe.unet, weight_path, '<new1>')
|
72 |
|
73 |
self.pipe = pipe
|
|
|
10 |
|
11 |
import torch
|
12 |
from diffusers import StableDiffusionPipeline
|
13 |
+
sys.path.insert(0, './custom-diffusion')
|
14 |
|
|
|
15 |
|
16 |
# def load_model(text_encoder, tokenizer, unet, save_path, modifier_token, freeze_model='crossattn_kv'):
|
17 |
# st = torch.load(save_path)
|
|
|
67 |
model_id, torch_dtype=torch.float16)
|
68 |
pipe = pipe.to(self.device)
|
69 |
|
70 |
+
from src import diffuser_training
|
71 |
diffuser_training.load_model(pipe.text_encoder, pipe.tokenizer, pipe.unet, weight_path, '<new1>')
|
72 |
|
73 |
self.pipe = pipe
|