From a38c7c4f6d7da03fec8ec5203fcc95a82d0d1779 Mon Sep 17 00:00:00 2001 From: Nicholas Albion Date: Sat, 9 Sep 2023 11:54:16 +1000 Subject: [PATCH] linting --- pilot/main.py | 6 ++---- pilot/utils/arguments.py | 2 +- pilot/utils/llm_connection.py | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pilot/main.py b/pilot/main.py index 751ea9a..8f4ab7c 100644 --- a/pilot/main.py +++ b/pilot/main.py @@ -2,18 +2,16 @@ from __future__ import print_function, unicode_literals import sys - from dotenv import load_dotenv from termcolor import colored -load_dotenv() - from helpers.Project import Project - from utils.arguments import get_arguments from utils.exit import exit_gpt_pilot from logger.logger import logger from database.database import database_exists, create_database, tables_exist, create_tables +load_dotenv() + def init(): # Check if the "euclid" database exists, if not, create it diff --git a/pilot/utils/arguments.py b/pilot/utils/arguments.py index cc7104c..e4409eb 100644 --- a/pilot/utils/arguments.py +++ b/pilot/utils/arguments.py @@ -53,7 +53,7 @@ def get_arguments(): else: arguments['app_id'] = str(uuid.uuid4()) print(colored('\n------------------ STARTING NEW PROJECT ----------------------', 'green', attrs=['bold'])) - print(f"If you wish to continue with this project in future run:") + print("If you wish to continue with this project in future run:") print(colored(f'python {sys.argv[0]} app_id={arguments["app_id"]}', 'green', attrs=['bold'])) print(colored('--------------------------------------------------------------\n', 'green', attrs=['bold'])) diff --git a/pilot/utils/llm_connection.py b/pilot/utils/llm_connection.py index 7a0b55c..72167f2 100644 --- a/pilot/utils/llm_connection.py +++ b/pilot/utils/llm_connection.py @@ -118,7 +118,7 @@ def create_gpt_chat_completion(messages: List[dict], req_type, min_tokens=MIN_TO # Check if the error message is related to token limit if "context_length_exceeded" in error_message.lower(): - raise Exception(f'Too many tokens in the request. Please try to continue the project with some previous development step.') + raise Exception('Too many tokens in the request. Please try to continue the project with some previous development step.') else: print('The request to OpenAI API failed. Here is the error message:') print(e) @@ -157,7 +157,7 @@ def retry_on_exception(func): time.sleep(wait_duration) continue - print(colored(f'There was a problem with request to openai API:', 'red')) + print(colored('There was a problem with request to openai API:', 'red')) print(err_str) user_message = questionary.text(