Skip to content

Commit

Permalink
fix: suppress CLIPFeatureExtractor warning
Browse files Browse the repository at this point in the history
  • Loading branch information
fboulnois committed Jan 26, 2023
1 parent 535ee69 commit 0b30e2b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions docker-entrypoint.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
import argparse, datetime, inspect, os
import argparse, datetime, inspect, os, warnings
import numpy as np
import torch
from PIL import Image
Expand Down Expand Up @@ -85,12 +85,14 @@ def stable_diffusion_pipeline(p):

print("load pipeline start:", iso_date_time(), flush=True)

pipeline = p.diffuser.from_pretrained(
p.model,
torch_dtype=p.dtype,
revision=p.revision,
use_auth_token=p.token,
).to(p.device)
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=FutureWarning)
pipeline = p.diffuser.from_pretrained(
p.model,
torch_dtype=p.dtype,
revision=p.revision,
use_auth_token=p.token,
).to(p.device)

if p.scheduler is not None:
scheduler = getattr(schedulers, p.scheduler)
Expand Down

0 comments on commit 0b30e2b

Please sign in to comment.