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:
raise ValueError(f"Found {field_name} supplied twice.")
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.
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)
invalid_model_kwargs = all_required_field_names.intersection(

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

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

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

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

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

Loading…
Cancel
Save