Skip to content
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

Add parseProgressFromLogs helper function #207

Merged
merged 6 commits into from
Feb 23, 2024
Merged

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Feb 19, 2024

import Replicate, { parseProgressFromLogs } from "replicate";

const replicate = new Replicate({})

const output = await replicate.run(model, { input }, (prediction) => {
  console.log(parseProgressFromLogs(prediction));
});

@mattt mattt changed the title Add parsePredictionProgress helper function Add parseProgress helper function Feb 21, 2024
@mattt mattt requested review from aron and a team February 21, 2024 11:37
@replicate replicate deleted a comment from arbajkhan140 Feb 21, 2024
@replicate replicate deleted a comment from arbajkhan140 Feb 21, 2024
Copy link
Member

@zeke zeke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious about what models this will work for. Is there a semi-standardized way of producing progress output from models?

I see this is documented in code, but this should have public docs in the README too.

@mattt
Copy link
Contributor Author

mattt commented Feb 22, 2024

Is there a semi-standardized way of producing progress output from models?

That formatting comes from tqdm, which is used by several packages commonly used in models, including 🤗 Diffusers:

By default, tqdm progress bars are displayed during model download. logging.disable_progress_bar and logging.enable_progress_bar are used to enable or disable this behavior.

@mattt mattt merged commit 60a8e18 into main Feb 23, 2024
9 checks passed
@mattt mattt deleted the mattt/prediction-progress branch February 23, 2024 14:14
@mattt mattt changed the title Add parseProgress helper function Add parseProgressFromLogs helper function Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants