-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image Annotation Moderation and FLUX Model Integration #65
Conversation
…age dataset annotations.
…General cleanup for PR.
bitmind/synthetic_image_generation/notebooks/gs1_nis100_1024_1024.ipynb
Outdated
Show resolved
Hide resolved
@@ -39,19 +41,36 @@ | |||
{ | |||
"path": "stabilityai/stable-diffusion-xl-base-1.0", | |||
"use_safetensors": True, | |||
"torch_dtype": torch.float16, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
torch_dtype
is no longer hardcoded, so it must be specified in the pipeline / DIFFUSER_ARGS
.
"path": 'black-forest-labs/FLUX.1-dev', | ||
"use_safetensors": True, | ||
"torch_dtype": torch.bfloat16, | ||
"generate_args": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguments decided based on experimental generation latencies.
} for m in VALIDATOR_MODEL_META['diffusers'] | ||
} | ||
|
||
GENERATE_ARGS = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New field for generation arguments, which FLUX-1.dev can utilize.
@@ -80,11 +140,17 @@ def generate_description(self, | |||
|
|||
if not verbose: | |||
transformers_logging.set_verbosity_info() | |||
|
|||
|
|||
if description.startswith(prompts[0]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check for the moderation model repeating the prompt in its response.
@@ -122,9 +136,13 @@ def clear_gpu(self): | |||
torch.cuda.empty_cache() | |||
self.diffuser = None | |||
|
|||
def load_diffuser(self, diffuser_name) -> None: | |||
def load_diffuser(self, diffuser_name, gpu_id=None) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added GPU parameterization for image generation parallelization. Defaults to cuda
if not specified (previous behavior).
bitmind/synthetic_image_generation/notebooks/gs1_nis100_1024_1024.ipynb
Outdated
Show resolved
Hide resolved
… logging cleanup.
This PR upgrades our synthetic image pipeline with a new state-of-the-art (SOTA) model and various quality of life enhancements. It introduces Black Forest Labs' advanced FLUX.1-dev model, upgrades our BLIP-2 annotation model from 2.7B to 6.7B parameters, and incorporates Unsloth's Meta-Llama-3.1-8B-Instruct-bnb-4bit for image moderation. Further refinements include optimized parameterization for both CPU and GPU operations, streamlined .env setup for automatic login credentials management, and verification of model loading before a validation starts.
Key Changes
Model Upgrades and Enhancements:
Infrastructure and Configuration:
min_compute.yml
to detail new GPU requirements like tflops.setup_validator_env.sh
andstart_validator.sh
to automate Weights * Biases API key and Hugging Face token user login.autoupdate_validator_steps.sh
sequence and executed prior tostart_validator.sh
. This modification eliminates the initial download delay when models are loaded for the first time.Code Quality and Maintenance: