Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -59,8 +59,8 @@ def generate_image(seed: int, truncation_psi: float, model: nn.Module,
|
|
59 |
return out[0].cpu().numpy()
|
60 |
|
61 |
|
62 |
-
def load_model(file_name: str, device: torch.device) -> nn.Module:
|
63 |
-
path = hf_hub_download('
|
64 |
f'{file_name}',
|
65 |
use_auth_token=TOKEN)
|
66 |
with open(path, 'rb') as f:
|
@@ -78,7 +78,7 @@ def main():
|
|
78 |
args = parse_args()
|
79 |
device = torch.device(args.device)
|
80 |
|
81 |
-
model = load_model('
|
82 |
|
83 |
func = functools.partial(generate_image, model=model, device=device)
|
84 |
func = functools.update_wrapper(func, generate_image)
|
|
|
59 |
return out[0].cpu().numpy()
|
60 |
|
61 |
|
62 |
+
def load_model(path:str, file_name: str, device: torch.device) -> nn.Module:
|
63 |
+
path = hf_hub_download(f'{path}',
|
64 |
f'{file_name}',
|
65 |
use_auth_token=TOKEN)
|
66 |
with open(path, 'rb') as f:
|
|
|
78 |
args = parse_args()
|
79 |
device = torch.device(args.device)
|
80 |
|
81 |
+
model = load_model('feng2022/Time-TravelRephotography_e4e_ffhq_encode','e4e_ffhq_encode.pt', device)
|
82 |
|
83 |
func = functools.partial(generate_image, model=model, device=device)
|
84 |
func = functools.update_wrapper(func, generate_image)
|