Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Raphael Glon <oOraph@users.noreply.github.com>
  • Loading branch information
oOraph committed Nov 29, 2023
1 parent 0e7543c commit 040c5db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions docker_images/diffusers/app/pipelines/image_to_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ def __init__(self, model_id: str):

# This should allow us to make the image work with private models when no token is provided, if the said model
# is already in local cache
cache_folder_name = file_download.repo_folder_name(
cache_root = os.getenv("DIFFUSERS_CACHE", os.getenv("HUGGINGFACE_HUB_CACHE"))
folder_name = file_download.repo_folder_name(
repo_id=model_id, repo_type="model"
)
filename = os.path.join(cache_folder_name, "hub_model_info.json")
folder_path = os.path.join(cache_root, folder_name)
filename = os.path.join(folder_path, "hub_model_info.json")
try:
with open(filename, "r") as f:
model_data = json.load(f)
Expand Down
6 changes: 4 additions & 2 deletions docker_images/diffusers/app/pipelines/text_to_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ def __init__(self, model_id: str):

# This should allow us to make the image work with private models when no token is provided, if the said model
# is already in local cache
cache_folder_name = file_download.repo_folder_name(
cache_root = os.getenv("DIFFUSERS_CACHE", os.getenv("HUGGINGFACE_HUB_CACHE"))
folder_name = file_download.repo_folder_name(
repo_id=model_id, repo_type="model"
)
filename = os.path.join(cache_folder_name, "hub_model_info.json")
folder_path = os.path.join(cache_root, folder_name)
filename = os.path.join(folder_path, "hub_model_info.json")
try:
with open(filename, "r") as f:
model_data = json.load(f)
Expand Down

0 comments on commit 040c5db

Please sign in to comment.