Skip to content

yival.experiment.data_processor

DataProcessor Objects

class DataProcessor()

Utility class to process data based on DatasetConfig.

process_data

def process_data() -> Iterator[List[InputData]]

Processes data based on the DatasetConfig and returns the processed data.

yival.experiment.experiment_runner

ExperimentRunner Objects

class ExperimentRunner()

parallel_task

def parallel_task(data_point, all_combinations, logger, evaluator)

Task to be run in parallel for processing data points.

run

def run(display: bool = True,
        interactive: bool = False,
        output_path: Optional[str] = "abc.pkl",
        experiment_input_path: Optional[str] = "abc.pkl",
        async_eval: bool = False,
        enhance_page: bool = False)

Run the experiment based on the source type and provided configuration.

yival.experiment.app.app

include_image_base64

def include_image_base64(data_dict)

Check if a string includes a base64 encoded image.

include_video

def include_video(data_dict)

Check if a string includes a video.

is_base64_image

def is_base64_image(value)

Check if a string is a base64 encoded image.

base64_to_img

def base64_to_img(base64_string)

Convert a base64 string into a PIL Image.

extract_and_decode_image_from_string

def extract_and_decode_image_from_string(data_string)

Extract and decode the first image from a string include base64 encoded and return a dictionary.

extract_and_decode_video_from_string

def extract_and_decode_video_from_string(data_string)

Extract and decode the first video from a string include video urls and return a dictionary.

extract_and_decode_image

def extract_and_decode_image(data_dict)

Extract and decode image from a dictionary include base64 encoded.

extract_and_decode_video

def extract_and_decode_video(data_dict)

Extract and decode video from a dictionary include video url.

create_table

def create_table(data)

Create an HTML table from a list of dictionaries, where the values can be strings or PIL images.

create_video_table

def create_video_table(data)

Create an HTML table from a list of dictionaries, where the values can be strings or video.

yival.experiment.app.utils

image_to_base64

def image_to_base64(image: Image.Image) -> str

Converts an image to base64 string.

generate_legend

def generate_legend()

Generates the legend for the heatmap.

yival.experiment.app

yival.experiment.app.hexagram

yival.experiment.stable_diffusion

yival.experiment.bot.interactive_bot

yival.experiment.bot

yival.experiment.bot.run_streamlit

extract_params

def extract_params(input_str)

Extract the parameters from the user input.

display_image

def display_image(image_list)

Display the image output from the experiment.

run_experiments

def run_experiments(selected_combinations, input_data, experiment_config,
                    logger, evaluator)

Run the experiment with lite_experiment

display_results

def display_results(results)

Display the results with bot messages after the experiment.

run_streamlit

def run_streamlit()

Run the experiment using the user input and pkl file.

yival.experiment.evaluator

Evaluator Objects

class Evaluator()

Utility class to evaluate ExperimentResult.

yival.experiment.utils

import_function_from_string

def import_function_from_string(func_string: str)

Helper function to import a function from a string.

get_yaml_args

def get_yaml_args(dataset)

Get argument from yaml.

get_function_args

def get_function_args(func_string: str, dataset: dict)

Get argument types of a function.

call_function_from_string

def call_function_from_string(func_string: str, **kwargs) -> Any

Call a function specified by a string.

yival.experiment.lite_experiment

LiteExperimentRunner Objects

class LiteExperimentRunner()

LiteExperimentRunner

This runner is designed for situation you already have assemble all datas & evaluators... And just want to get experiment results on given data

And you can easily update all variations through /update_variations()/

:)

parallel_task

def parallel_task(data, all_combinations, logger, evaluator)

Execute a single input run in parallel

set_variations

def set_variations(variations: List[Dict[str, List[str]]])

set all variations for current experiment variations are format in [ { var1_name: ["a","b","c"] }, { var2_name: ["d","e","f"] } ]

yival.experiment.rate_limiter