feedback_forensics.app.utils#

Module Contents#

Functions#

get_image_path

Get the path to an image in the assets directory.

get_gradio_image_path

Get the path to an image in the assets directory, via gradio files api.

get_csv_columns

Get the column names from a CSV file.

load_json_file

Load a JSON file.

iter_to_trunc_str

Convert an iterable to a string with maximum item count.

API#

feedback_forensics.app.utils.get_image_path(image_name: str) pathlib.Path#

Get the path to an image in the assets directory.

feedback_forensics.app.utils.get_gradio_image_path(image_name: str) str#

Get the path to an image in the assets directory, via gradio files api.

feedback_forensics.app.utils.get_csv_columns(file_path: str | pathlib.Path) list[str]#

Get the column names from a CSV file.

Args: file_path: Path to the CSV file

Returns: List of column names

feedback_forensics.app.utils.load_json_file(file_path: str | pathlib.Path) dict#

Load a JSON file.

Args: file_path: Path to the JSON file

feedback_forensics.app.utils.iter_to_trunc_str(iter, max_items)#

Convert an iterable to a string with maximum item count.