Commit dc48673d authored by kurumuz's avatar kurumuz

lets see

parent 21c82799
...@@ -338,24 +338,26 @@ class StableDiffusionModel(nn.Module): ...@@ -338,24 +338,26 @@ class StableDiffusionModel(nn.Module):
def from_url(self, url): def from_url(self, url):
#read config url into bytes #read config url into bytes
s3_file = self.config.model_path + "/config.yaml" url = f"https://{self.config.s3_bucket}/{self.config.s3_folder}/config.yaml"
s3_file = self.config.s3_folder + "/config.yaml"
headers = web.get_s3_secret_headers(endpoint=self.config.s3_endpoint, headers = web.get_s3_secret_headers(endpoint=self.config.s3_endpoint,
access_key=self.config.s3_access_key, access_key=self.config.s3_access_key,
secret_key=self.config.s3_secret_key, secret_key=self.config.s3_secret_key,
bucket=self.config.s3_bucket,
s3_file=s3_file s3_file=s3_file
) )
url = "https://" + self.config.s3_endpoint + "/" +s3_file
tensor_loader = web.CURLStreamFile(url, headers=headers) tensor_loader = web.CURLStreamFile(url, headers=headers)
model_config = OmegaConf.load(tensor_loader) model_config = OmegaConf.load(tensor_loader)
s3_file = self.config.model_path + "/model.ckpt" s3_file = self.config.s3_folder + "/model.ckpt"
url = f"https://{self.config.s3_bucket}/{self.config.s3_folder}/model.ckpt"
print(f"Downloading model from {url}") print(f"Downloading model from {url}")
headers = web.get_s3_secret_headers(endpoint=self.config.s3_endpoint, headers = web.get_s3_secret_headers(endpoint=self.config.s3_endpoint,
access_key=self.config.s3_access_key, access_key=self.config.s3_access_key,
secret_key=self.config.s3_secret_key, secret_key=self.config.s3_secret_key,
bucket=self.config.s3_bucket,
s3_file=s3_file s3_file=s3_file
) )
url = "https://" + self.config.s3_endpoint + "/" +s3_file
tensor_loader = web.CURLStreamFile(url, headers=headers) tensor_loader = web.CURLStreamFile(url, headers=headers)
model = self.load_model_from_config(model_config, tensor_loader) model = self.load_model_from_config(model_config, tensor_loader)
return model, model_config return model, model_config
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment