Skip to main content

utils

superduper.ext.utils

Source code

str_shape​

str_shape(shape: Sequence[int]) -> str
ParameterDescription
shapeThe shape to convert.

Convert a shape to a string.

format_prompt​

format_prompt(X: str,
prompt: str,
context: Optional[List[str]] = None) -> str
ParameterDescription
XThe input to format the prompt with.
promptThe prompt to format.
contextThe context to format the prompt with.

Format a prompt with the given input and context.

get_key​

get_key(key_name: str) -> str
ParameterDescription
key_nameThe name of the environment variable to get.

Get an environment variable.