Merge pull request #181 from evelynmitchell/master

black formatting, renamed tests for pytest autodiscovery
pull/188/head
Eternal Reclaimer 1 year ago committed by GitHub
commit 55a1dfac3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -185,9 +185,11 @@ def build_extra_kwargs(
if field_name in extra_kwargs: if field_name in extra_kwargs:
raise ValueError(f"Found {field_name} supplied twice.") raise ValueError(f"Found {field_name} supplied twice.")
if field_name not in all_required_field_names: if field_name not in all_required_field_names:
warnings.warn(f"""WARNING! {field_name} is not default parameter. warnings.warn(
f"""WARNING! {field_name} is not default parameter.
{field_name} was transferred to model_kwargs. {field_name} was transferred to model_kwargs.
Please confirm that {field_name} is what you intended.""") Please confirm that {field_name} is what you intended."""
)
extra_kwargs[field_name] = values.pop(field_name) extra_kwargs[field_name] = values.pop(field_name)
invalid_model_kwargs = all_required_field_names.intersection( invalid_model_kwargs = all_required_field_names.intersection(

@ -168,10 +168,8 @@ class Dalle3:
# Handling exceptions and printing the errors details # Handling exceptions and printing the errors details
print( print(
colored( colored(
(
f"Error running Dalle3: {error} try optimizing your api" f"Error running Dalle3: {error} try optimizing your api"
" key and or try again" " key and or try again",
),
"red", "red",
) )
) )
@ -233,10 +231,8 @@ class Dalle3:
except (Exception, openai.OpenAIError) as error: except (Exception, openai.OpenAIError) as error:
print( print(
colored( colored(
(
f"Error running Dalle3: {error} try optimizing your api" f"Error running Dalle3: {error} try optimizing your api"
" key and or try again" " key and or try again",
),
"red", "red",
) )
) )
@ -310,10 +306,8 @@ class Dalle3:
except Exception as error: except Exception as error:
print( print(
colored( colored(
(
f"Error running Dalle3: {error} try optimizing" f"Error running Dalle3: {error} try optimizing"
" your api key and or try again" " your api key and or try again",
),
"red", "red",
) )
) )

@ -291,10 +291,8 @@ class HuggingfaceLLM:
except Exception as e: except Exception as e:
print( print(
colored( colored(
(
"HuggingfaceLLM could not generate text because of" "HuggingfaceLLM could not generate text because of"
f" error: {e}, try optimizing your arguments" f" error: {e}, try optimizing your arguments",
),
"red", "red",
) )
) )

@ -140,10 +140,8 @@ class SSD1B:
# Handling exceptions and printing the errors details # Handling exceptions and printing the errors details
print( print(
colored( colored(
(
f"Error running SSD1B: {error} try optimizing your api" f"Error running SSD1B: {error} try optimizing your api"
" key and or try again" " key and or try again",
),
"red", "red",
) )
) )
@ -228,10 +226,8 @@ class SSD1B:
except Exception as error: except Exception as error:
print( print(
colored( colored(
(
f"Error running SSD1B: {error} try optimizing" f"Error running SSD1B: {error} try optimizing"
" your api key and or try again" " your api key and or try again",
),
"red", "red",
) )
) )

@ -489,10 +489,8 @@ class Flow:
except Exception as error: except Exception as error:
print( print(
colored( colored(
(
"Error activating autonomous agent. Try optimizing your" "Error activating autonomous agent. Try optimizing your"
" parameters..." " parameters...",
),
"red", "red",
) )
) )

@ -385,11 +385,9 @@ class SequentialWorkflow:
except Exception as e: except Exception as e:
print( print(
colored( colored(
(
f"Error initializing the Sequential workflow: {e} try" f"Error initializing the Sequential workflow: {e} try"
" optimizing your inputs like the flow class and task" " optimizing your inputs like the flow class and task"
" description" " description",
),
"red", "red",
attrs=["bold", "underline"], attrs=["bold", "underline"],
) )

Loading…
Cancel
Save