black formatting

pull/307/head
evelynmitchell 1 year ago committed by Zack
parent 633c5a1d71
commit 0c6bc9b281

@ -200,9 +200,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(

@ -170,17 +170,9 @@ class Dalle3:
# Handling exceptions and printing the errors details # Handling exceptions and printing the errors details
print( print(
colored( colored(
(
<<<<<<< HEAD
f"Error running Dalle3: {error} try"
" optimizing your api key and or try again"
=======
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"
>>>>>>> 49c7b97c (code quality fixes: line length = 80)
), ),
"red",
)
) )
raise error raise error
@ -243,13 +235,8 @@ class Dalle3:
print( print(
colored( colored(
( (
<<<<<<< HEAD
f"Error running Dalle3: {error} try"
" optimizing your api key and or try again"
=======
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"
>>>>>>> 49c7b97c (code quality fixes: line length = 80)
), ),
"red", "red",
) )
@ -333,41 +320,18 @@ class Dalle3:
except Exception as error: except Exception as error:
print( print(
colored( colored(
(
<<<<<<< HEAD
f"Error running Dalle3: {error} try"
" optimizing your api key and or try"
" again"
=======
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"
>>>>>>> 49c7b97c (code quality fixes: line length = 80)
),
"red",
)
)
print(
colored(
<<<<<<< HEAD
(
"Error running Dalle3:"
f" {error.http_status}"
),
"red", "red",
) )
) )
print( print(
colored( colored(
f"Error running Dalle3: {error.error}",
"red",
)
=======
f"Error running Dalle3: {error.http_status}", "red" f"Error running Dalle3: {error.http_status}", "red"
) )
) )
print( print(
colored(f"Error running Dalle3: {error.error}", "red") colored(f"Error running Dalle3: {error.error}", "red")
>>>>>>> 49c7b97c (code quality fixes: line length = 80)
) )
raise error raise error

@ -189,15 +189,7 @@ class HuggingfaceLLM:
# raise # raise
print( print(
colored( colored(
<<<<<<< HEAD
(
"Failed to load the model and or the"
f" tokenizer: {e}"
),
"red",
=======
f"Failed to load the model and or the tokenizer: {e}", "red" f"Failed to load the model and or the tokenizer: {e}", "red"
>>>>>>> 49c7b97c (code quality fixes: line length = 80)
) )
) )
@ -231,12 +223,7 @@ class HuggingfaceLLM:
self.model = DDP(self.model) self.model = DDP(self.model)
except Exception as error: except Exception as error:
self.logger.error( self.logger.error(
<<<<<<< HEAD
"Failed to load the model or the tokenizer:"
f" {error}"
=======
f"Failed to load the model or the tokenizer: {error}" f"Failed to load the model or the tokenizer: {error}"
>>>>>>> 49c7b97c (code quality fixes: line length = 80)
) )
raise raise
@ -278,13 +265,9 @@ class HuggingfaceLLM:
self.print_dashboard(task) self.print_dashboard(task)
try: try:
<<<<<<< HEAD
inputs = self.tokenizer.encode(task, return_tensors="pt")
=======
inputs = self.tokenizer.encode(task, return_tensors="pt").to( inputs = self.tokenizer.encode(task, return_tensors="pt").to(
self.device self.device
) )
>>>>>>> 49c7b97c (code quality fixes: line length = 80)
# self.log.start() # self.log.start()
@ -324,18 +307,9 @@ class HuggingfaceLLM:
except Exception as e: except Exception as e:
print( print(
colored( colored(
(
<<<<<<< HEAD
"HuggingfaceLLM could not generate text"
f" because of error: {e}, try optimizing your"
" arguments"
=======
"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"
>>>>>>> 49c7b97c (code quality fixes: line length = 80)
), ),
"red",
)
) )
raise raise
@ -357,15 +331,9 @@ class HuggingfaceLLM:
self.print_dashboard(task) self.print_dashboard(task)
try: try:
<<<<<<< HEAD
inputs = self.tokenizer.encode(
task, return_tensors="pt"
).to(self.device)
=======
inputs = self.tokenizer.encode(task, return_tensors="pt").to( inputs = self.tokenizer.encode(task, return_tensors="pt").to(
self.device self.device
) )
>>>>>>> 49c7b97c (code quality fixes: line length = 80)
# self.log.start() # self.log.start()

@ -144,18 +144,11 @@ class SSD1B:
# Handling exceptions and printing the errors details # Handling exceptions and printing the errors details
print( print(
colored( colored(
(
<<<<<<< HEAD
f"Error running SSD1B: {error} try optimizing"
" your api key and or try again"
=======
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"
>>>>>>> 49c7b97c (code quality fixes: line length = 80)
),
"red", "red",
) )
) );
raise error raise error
def _generate_image_name(self, task: str): def _generate_image_name(self, task: str):
@ -239,41 +232,17 @@ class SSD1B:
except Exception as error: except Exception as error:
print( print(
colored( colored(
(
<<<<<<< HEAD
f"Error running SSD1B: {error} try"
" optimizing your api key and or try"
" again"
=======
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",
>>>>>>> 49c7b97c (code quality fixes: line length = 80)
),
"red",
)
)
print(
colored(
<<<<<<< HEAD
(
"Error running SSD1B:"
f" {error.http_status}"
),
"red", "red",
) )
) )
print( print(
colored( colored(
f"Error running SSD1B: {error.error}",
"red",
)
)
=======
f"Error running SSD1B: {error.http_status}", "red" f"Error running SSD1B: {error.http_status}", "red"
) )
) )
print(colored(f"Error running SSD1B: {error.error}", "red")) print(colored(f"Error running SSD1B: {error.error}", "red"))
>>>>>>> 49c7b97c (code quality fixes: line length = 80)
raise error raise error
def _generate_uuid(self): def _generate_uuid(self):

@ -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",
) )
) )

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

Loading…
Cancel
Save