Skip to content

Instantly share code, notes, and snippets.

@nousr
Created August 2, 2022 23:00
Show Gist options
  • Save nousr/267205e84fee37f9a2017aa1e2572572 to your computer and use it in GitHub Desktop.
Save nousr/267205e84fee37f9a2017aa1e2572572 to your computer and use it in GitHub Desktop.
A working example that will make a caption/image table and upload it to wandb for evaluation.
import torch
from dream_bench import benchmark, DreamBenchConfig
def mock_harness(conditioning_args):
caption = conditioning_args["caption.txt"]
tokenized_text = conditioning_args["tokenized_text.npy"]
img_emb = conditioning_args["prior_image_embedding.npy"]
return torch.rand((img_emb.shape[0], 3, 256, 256))
def main():
config = DreamBenchConfig.from_json_path("configs/example_config.json")
benchmark(adapter=mock_harness, config=config)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment