Expand description
Helper struct for the prediction struct
Used to create a prediction, reload for latest info, cancel it and wait for prediction to complete.
§Example
use replicate_rust::{Replicate, config::Config};
let config = Config::default();
let replicate = Replicate::new(config);
// Creating the inputs
let mut inputs = std::collections::HashMap::new();
inputs.insert("prompt", "a 19th century portrait of a wombat gentleman");
let version = "stability-ai/stable-diffusion:27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478";
// Create a new prediction
let mut prediction = replicate.predictions.create(version, inputs)?;
// Reload the prediction to get the latest info and logs
prediction.reload()?;
// Cancel the prediction
// prediction.cancel()?;
// Wait for the prediction to complete
let result = prediction.wait()?;
println!("Result : {:?}", result);
Structs§
- Prediction
Client - Helper struct for the Prediction struct. Used to create a prediction, reload for latest info, cancel it and wait for prediction to complete.
Functions§
- parse_
version - Parse a model version string into its model and version parts.