question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How much of a common API do you expect there to be across different objects? For example, the unet.py file contains a Trainer, while other models seem to only rely on their forward method, but they have different APIs and signatures.

Same with pipelines, for example with the BDDM pipeline having the following arguments for it’s __call__ method: mel_spectrogram, generator, torch_device=None, while the DDIM pipeline has batch_size=1, generator=None, torch_device=None, eta=0.0, num_inference_steps=50.

Do we expect all of these models, pipelines, schedulers to have a common API at the end? Is that even possible with diffusers?

It seems like most arguments are similar, but with a few specificities for models, pipelines and schedulers. That’s where having a configuration system would arguably work quite well as it would show very visibly what each of them has in terms of arguments for customization.

This reminds me a bit of the do_lower_case problem we have in transformers: some tokenizers have it, some don’t, but users don’t necessarily understand that and try to use it for all tokenizers.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:5
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
patil-surajcommented, Jun 15, 2022

Thanks @kashif . I think this is exactly what @anton-l proposed with task/modality specific sub-classes.

2reactions
kashifcommented, Jun 15, 2022

One thing that is sometimes missing with the models’s forward is the notion of a context or conditioning… typically for the image gen. there is no conditioning, however for other modalities conditioning might be needed so if we can also add that in the forward and by default make it none, it will be helpful!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Top 50 Most Popular APIs (Updated for 2022) - RapidAPI
With over 400 billion API calls per month, we analyzed the data to see which APIs were the most popular, starting with the...
Read more >
Common API
These Application Programming Interfaces (APIs) are used for instance to exchange information between mobile apps and the respective banks. Unification would ...
Read more >
API - Wikipedia
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type...
Read more >
5 Examples of APIs We Use in Our Everyday Lives
1. Weather Snippets. Google utilizes APIs to display relevant data from user search queries. One common API usage example we come across on...
Read more >
Common API — sagemaker 2.29.0 documentation
The following SageMaker distribute model parallel APIs are common across all frameworks. Important: This API document assumes you use the following import ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found