fix bugs
This commit is contained in:
+1
-1
@@ -7,6 +7,6 @@ cog predict --gpus $GPU_ID \
|
||||
-i concept_mode="face" \
|
||||
-i sd_model_version="sdxl" \
|
||||
-i max_train_steps="360" \
|
||||
-i caption_model="gpt4-v" \
|
||||
-i caption_model="blip" \
|
||||
-i debug="False" \
|
||||
-i seed="0"
|
||||
+1
-7
@@ -86,10 +86,6 @@ class Predictor(BasePredictor):
|
||||
description="Number of steps between saving checkpoints. Set to very very high number to disable checkpointing, because you don't need intermediate checkpoints.",
|
||||
default=10000,
|
||||
),
|
||||
is_lora: bool = Input(
|
||||
description="Whether to use LoRA training. If set to False, will use full fine tuning",
|
||||
default=True,
|
||||
),
|
||||
unet_lr: float = Input(
|
||||
description="final learning rate of unet (after warmup)",
|
||||
default=0.001,
|
||||
@@ -144,15 +140,13 @@ class Predictor(BasePredictor):
|
||||
train_batch_size=train_batch_size,
|
||||
max_train_steps=max_train_steps,
|
||||
checkpointing_steps=checkpointing_steps,
|
||||
is_lora=is_lora,
|
||||
prodigy_d_coef=prodigy_d_coef,
|
||||
ti_lr=ti_lr,
|
||||
unet_lr=unet_lr,
|
||||
lora_rank=lora_rank,
|
||||
caption_model=caption_model,
|
||||
n_tokens=n_tokens,
|
||||
verbose=verbose,
|
||||
debug=debug,
|
||||
text_encoder_lora_optimizer=text_encoder_lora_optimizer,
|
||||
freeze_ti_after_completion_f=freeze_ti_after_completion_f,
|
||||
token_warmup_steps=token_warmup_steps
|
||||
)
|
||||
|
||||
@@ -521,7 +521,14 @@ def gpt4_v_caption_dataset(
|
||||
}
|
||||
|
||||
response = requests.post("https://api.openai.com/v1/chat/completions", headers=headers, json=payload)
|
||||
return index, response.json()["choices"][0]["message"]["content"]
|
||||
|
||||
try:
|
||||
result = response.json()["choices"][0]["message"]["content"]
|
||||
except:
|
||||
print(response.json())
|
||||
result = ""
|
||||
|
||||
return index, result
|
||||
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=batch_size) as executor:
|
||||
future_to_index = {executor.submit(fetch_caption, i, img): i for i, img in enumerate(images) if captions[i] is None}
|
||||
|
||||
@@ -37,6 +37,8 @@ def replace_in_string(s, replacements):
|
||||
return s
|
||||
|
||||
def fix_prompt(prompt: str):
|
||||
if not prompt:
|
||||
return prompt
|
||||
# Remove extra commas and spaces, and fix space before punctuation
|
||||
prompt = re.sub(r"\s+", " ", prompt) # Replace multiple spaces with a single space
|
||||
prompt = re.sub(r",,", ",", prompt) # Replace double commas with a single comma
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"output_dir": "lora_models/xander_best",
|
||||
"sd_model_version": "sd15",
|
||||
"lora_training_urls": "/home/rednax/Documents/datasets/people/xander",
|
||||
"sd_model_version": "sdxl",
|
||||
"lora_training_urls": "https://storage.googleapis.com/public-assets-xander/A_workbox/lora_training_sets/xander_5.zip",
|
||||
"concept_mode": "face",
|
||||
"seed": 0,
|
||||
"resolution": 512,
|
||||
|
||||
Reference in New Issue
Block a user