Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions fastgen/callbacks/wandb.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def init_wandb(config: BaseConfig):
# wandb login
wandb_credential = config.log_config.wandb_credential
if os.path.isfile(wandb_credential):
os.environ["WANDB_API_KEY"] = open(wandb_credential, encoding="utf-8").read().strip("\n")
with open(wandb_credential, encoding="utf-8") as f:
os.environ["WANDB_API_KEY"] = f.read().strip("\n")
logger.info(f"Loading WANDB_API_KEY from {wandb_credential}")

wandb_config = config.log_config
Expand All @@ -101,7 +102,8 @@ def init_wandb(config: BaseConfig):
os.makedirs(wandb_config.save_path, exist_ok=True)
wandb_id_path = f"{wandb_config.save_path}/wandb_id.txt"
if os.path.isfile(wandb_id_path):
wandb_id = open(wandb_id_path, encoding="utf-8").read().strip()
with open(wandb_id_path, encoding="utf-8") as f:
wandb_id = f.read().strip()
logger.info(f"Resuming with an existing wandb id: {wandb_id}")
else:
wandb_id = wandb.util.generate_id()
Expand Down
2 changes: 1 addition & 1 deletion fastgen/third_party/wan_prompt_expand/prompt_expand.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def __init__(self, model_name=None, device=0, is_vl=False, **kwargs):
)
try:
from .qwen_vl_utils import process_vision_info
except:
except ImportError:
from qwen_vl_utils import process_vision_info
self.process_vision_info = process_vision_info
min_pixels = 256 * 28 * 28
Expand Down