From 5a1bd48d94b97480bf654ff4156fea10f275626e Mon Sep 17 00:00:00 2001 From: Rene Teigen Date: Sun, 5 Feb 2023 11:36:23 +0000 Subject: [PATCH 1/6] Fix regression in full discord server indexing Add back response mode, only on vector index queries Added the llmpredictor to queries Fix docker build Update requirements --- Dockerfile | 6 +++--- cogs/commands.py | 20 +++++++++++++------- cogs/index_service_cog.py | 22 ++++++++++++++++++++-- models/autocomplete_model.py | 24 +++++++++++++++++++++--- models/index_model.py | 31 +++++++++++++++++-------------- requirements.txt | 2 +- 6 files changed, 75 insertions(+), 30 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3260cf2..5e7b98a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,9 +9,9 @@ COPY . . RUN mkdir /install /src WORKDIR /install RUN pip install --target="/install" --upgrade pip setuptools wheel -RUN pip install setuptools_rust -RUN pip install torch==1.9.1+cpu torchvision==0.10.1+cpu -f https://download.pytorch.org/whl/torch_stable.html -RUN pip install git+https://github.com/openai/whisper.git +RUN pip install --target="/install" --upgrade setuptools_rust +RUN pip install --target="/install" --upgrade torch==1.9.1+cpu torchvision==0.10.1+cpu -f https://download.pytorch.org/whl/torch_stable.html +RUN pip install --target="/install" --upgrade git+https://github.com/openai/whisper.git COPY requirements.txt /install RUN pip install --target="/install" -r requirements.txt COPY README.md /src diff --git a/cogs/commands.py b/cogs/commands.py index 2fc30ca..63acc24 100644 --- a/cogs/commands.py +++ b/cogs/commands.py @@ -532,13 +532,19 @@ class Commands(discord.Cog, name="Commands"): ) @discord.guild_only() @discord.option( - name="index", - description="Which file to load the index from", - required=True, - autocomplete=File_autocompleter.get_indexes, + name="user_index", + description="Which user file to load the index from", + required=False, + autocomplete=File_autocompleter.get_user_indexes, + ) + @discord.option( + name="server_index", + description="Which serever file to load the index from", + required=False, + autocomplete=File_autocompleter.get_server_indexes, ) - async def load_index(self, ctx: discord.ApplicationContext, index: str): - await self.index_cog.load_index_command(ctx, index) + async def load_index(self, ctx: discord.ApplicationContext, user_index: str, server_index: str): + await self.index_cog.load_index_command(ctx, user_index, server_index) @add_to_group("index") @discord.slash_command( @@ -624,7 +630,7 @@ class Commands(discord.Cog, name="Commands"): @discord.option(name="query", description="What to query the index", required=True) @discord.option( name="response_mode", - description="Response mode", + description="Response mode, doesn't work on deep composed indexes", guild_ids=ALLOWED_GUILDS, required=False, default="default", diff --git a/cogs/index_service_cog.py b/cogs/index_service_cog.py index 14fee92..ef0b4a2 100644 --- a/cogs/index_service_cog.py +++ b/cogs/index_service_cog.py @@ -95,8 +95,26 @@ class IndexService(discord.Cog, name="IndexService"): await ctx.defer(ephemeral=True) await self.index_handler.backup_discord(ctx, user_api_key=user_api_key) - async def load_index_command(self, ctx, index): + async def load_index_command(self, ctx, user_index, server_index): """Command handler to backup the entire server""" + + if not user_index and not server_index: + await ctx.respond("Please provide a user or server index") + return + + if user_index and server_index: + await ctx.respond( + "Please provide only one user index or server index. Only one or the other." + ) + return + + if server_index: + index = server_index + server = True + else: + index = user_index + server = False + user_api_key = None if USER_INPUT_API_KEYS: user_api_key = await TextService.get_user_api_key( @@ -106,7 +124,7 @@ class IndexService(discord.Cog, name="IndexService"): return await ctx.defer(ephemeral=True) - await self.index_handler.load_index(ctx, index, user_api_key) + await self.index_handler.load_index(ctx, index, server, user_api_key) async def query_command(self, ctx, query, response_mode): """Command handler to query your index""" diff --git a/models/autocomplete_model.py b/models/autocomplete_model.py index bde41ef..7a38481 100644 --- a/models/autocomplete_model.py +++ b/models/autocomplete_model.py @@ -150,8 +150,8 @@ class File_autocompleter: except Exception: return ["No 'openers' folder"] - async def get_indexes(ctx: discord.AutocompleteContext): - """get all files in the openers folder""" + async def get_user_indexes(ctx: discord.AutocompleteContext): + """get all files in the indexes folder""" try: return [ file @@ -165,4 +165,22 @@ class File_autocompleter: :25 ] # returns the 25 first files from your current input except Exception: - return ["No 'indexes' folder"] + return ["No user indexes found, add an index"] + + + async def get_server_indexes(ctx: discord.AutocompleteContext): + """get all files in the indexes folder""" + try: + return [ + file + for file in os.listdir( + EnvService.find_shared_file( + f"indexes/{str(ctx.interaction.guild.id)}/" + ) + ) + if file.startswith(ctx.value.lower()) + ][ + :25 + ] # returns the 25 first files from your current input + except Exception: + return ["No server indexes found, add an index"] diff --git a/models/index_model.py b/models/index_model.py index 786e66d..21737d3 100644 --- a/models/index_model.py +++ b/models/index_model.py @@ -8,7 +8,8 @@ import aiofiles from functools import partial from typing import List, Optional from pathlib import Path -from datetime import date, datetime +from datetime import date +from langchain import OpenAI from gpt_index.readers import YoutubeTranscriptReader from gpt_index.readers.schema.base import Document @@ -17,12 +18,12 @@ from gpt_index import ( SimpleDirectoryReader, QuestionAnswerPrompt, BeautifulSoupWebReader, - GPTFaissIndex, GPTListIndex, QueryMode, GPTTreeIndex, GoogleDocsReader, MockLLMPredictor, + LLMPredictor, QueryConfig, IndexStructType, ) @@ -35,15 +36,14 @@ from services.environment_service import EnvService, app_root_path SHORT_TO_LONG_CACHE = {} -def get_and_query(user_id, index_storage, query, llm_predictor): - # TODO Do prediction here for token usage +def get_and_query(user_id, index_storage, query, response_mode, llm_predictor): index: [GPTSimpleVectorIndex, ComposableGraph] = index_storage[ user_id ].get_index_or_throw() if isinstance(index, GPTTreeIndex): - response = index.query(query, verbose=True, child_branch_factor=2) + response = index.query(query, verbose=True, child_branch_factor=2, llm_predictor=llm_predictor) else: - response = index.query(query, verbose=True) + response = index.query(query, response_mode=response_mode, verbose=True, llm_predictor=llm_predictor) return response @@ -66,7 +66,7 @@ class IndexData: def has_indexes(self, user_id): try: return len(os.listdir(f"{app_root_path()}/indexes/{user_id}")) > 0 - except: + except Exception: return False def add_index(self, index, user_id, file_name): @@ -93,9 +93,8 @@ class IndexData: for file in os.listdir(f"{app_root_path()}/indexes/{user_id}"): os.remove(f"{app_root_path()}/indexes/{user_id}/{file}") - except: + except Exception: traceback.print_exc() - pass class Index_handler: @@ -271,14 +270,17 @@ class Index_handler: await ctx.respond("Failed to set index") traceback.print_exc() - async def load_index(self, ctx: discord.ApplicationContext, index, user_api_key): + async def load_index(self, ctx: discord.ApplicationContext, index, server, user_api_key): if not user_api_key: os.environ["OPENAI_API_KEY"] = self.openai_key else: os.environ["OPENAI_API_KEY"] = user_api_key try: - index_file = EnvService.find_shared_file(f"indexes/{ctx.user.id}/{index}") + if server: + index_file = EnvService.find_shared_file(f"indexes/{ctx.guild.id}/{index}") + else: + index_file = EnvService.find_shared_file(f"indexes/{ctx.user.id}/{index}") index = await self.loop.run_in_executor( None, partial(self.index_load_file, index_file) ) @@ -353,10 +355,11 @@ class Index_handler: index = await self.loop.run_in_executor( None, partial(self.index_discord, document) ) - Path(app_root_path() / "indexes").mkdir(parents=True, exist_ok=True) + Path(app_root_path() / "indexes" / str(ctx.guild.id)).mkdir(parents=True, exist_ok=True) index.save_to_disk( app_root_path() / "indexes" + / str(ctx.guild.id) / f"{ctx.guild.name.replace(' ', '-')}_{date.today().month}_{date.today().day}.json" ) @@ -374,11 +377,11 @@ class Index_handler: os.environ["OPENAI_API_KEY"] = user_api_key try: - llm_predictor = MockLLMPredictor(max_tokens=256) + llm_predictor = LLMPredictor(llm=OpenAI(model_name="text-davinci-003")) response = await self.loop.run_in_executor( None, partial( - get_and_query, ctx.user.id, self.index_storage, query, llm_predictor + get_and_query, ctx.user.id, self.index_storage, query, response_mode, llm_predictor ), ) print("The last token usage was ", llm_predictor.last_token_usage) diff --git a/requirements.txt b/requirements.txt index d0ac6f3..7acee75 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ sqlitedict==2.1.0 backoff==2.2.1 flask==2.2.2 beautifulsoup4==4.11.1 -gpt-index==0.3.4 +gpt-index==0.3.5 PyPDF2==3.0.1 youtube_transcript_api==0.5.0 sentencepiece==0.1.97 From f556c94b6a376ccddddab5f31aa09b80eba61028 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Sun, 5 Feb 2023 11:59:48 +0000 Subject: [PATCH 2/6] Format Python code with psf/black push --- models/search_model.py | 1 - 1 file changed, 1 deletion(-) diff --git a/models/search_model.py b/models/search_model.py index 2cc0f97..e1ca823 100644 --- a/models/search_model.py +++ b/models/search_model.py @@ -76,7 +76,6 @@ class Search: except Exception as e: traceback.print_exc() - index = GPTSimpleVectorIndex(documents) # Now we can search the index for a query: From 3952842856b6423bdf3b3316cbe3866bfb858105 Mon Sep 17 00:00:00 2001 From: Rene Teigen Date: Sun, 5 Feb 2023 13:24:34 +0000 Subject: [PATCH 3/6] Add setting top_k amount to the query command Count LLM tokens for deep compose Update presentation of cost in the console Update readme Set a prompthelper at 500 tokens output up from the default 256 I believe. ~4 characters per token so the discord limit is around 500 tokens. --- README.md | 6 +++--- cogs/commands.py | 16 +++++++++++++--- cogs/index_service_cog.py | 4 ++-- models/index_model.py | 18 ++++++++++++------ services/usage_service.py | 2 +- 5 files changed, 31 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 71bb218..717388c 100644 --- a/README.md +++ b/README.md @@ -105,9 +105,9 @@ This bot supports per-user custom indexes. This means that users can upload file `/index add file: or link:` - Use a document or use a link to create/add to your indexes. If you provide a youtube link, the transcript of the video will be used. If you provide a web url, the contents of the webpage will be used, if you provide an image, the image text will be extracted and used! -`/index query query:` - Query your current index for a given prompt. GPT will answer based on your current document/indedx +`/index query query: nodes: response_mode:` - Query your current index for a given prompt. GPT will answer based on your current document/index. You can also set it to query over more nodes, further refining the output over each one. A description of the modes can be found here. They do not work for deep composed indexes -`/index load index:` - Load a previously created index to query +`/index load user_index: or server_index:` - Load a previously created index you own yourself, or an index for the whole server. `/index compose` - Combine multiple saved indexes into one, or upgrade existing indexes into Deep Compositions. @@ -115,7 +115,7 @@ This bot supports per-user custom indexes. This means that users can upload file `/index add_discord channel:` - Create an add an index based on a discord channel -`/index discord_backup` - Use the last 3000 messages of every channel on your discord server as an index +`/index discord_backup` - Use the last 3000 messages of every channel on your discord server as an index. Needs both an admin and a index role ### System and Settings diff --git a/cogs/commands.py b/cogs/commands.py index 63acc24..d4f8f67 100644 --- a/cogs/commands.py +++ b/cogs/commands.py @@ -539,7 +539,7 @@ class Commands(discord.Cog, name="Commands"): ) @discord.option( name="server_index", - description="Which serever file to load the index from", + description="Which server file to load the index from", required=False, autocomplete=File_autocompleter.get_server_indexes, ) @@ -617,6 +617,7 @@ class Commands(discord.Cog, name="Commands"): name="discord_backup", description="Save an index made from the whole server", guild_ids=ALLOWED_GUILDS, + checks=[Check.check_admin_roles(), Check.check_index_roles()] ) @discord.guild_only() async def discord_backup(self, ctx: discord.ApplicationContext): @@ -628,6 +629,15 @@ class Commands(discord.Cog, name="Commands"): ) @discord.guild_only() @discord.option(name="query", description="What to query the index", required=True) + @discord.option( + name="nodes", + description="How many nodes should the response be queried from, only non-deep indexes", + required=False, + default=1, + min_value=1, + max_value=3, + input_type=discord.SlashCommandOptionType.integer, + ) @discord.option( name="response_mode", description="Response mode, doesn't work on deep composed indexes", @@ -637,9 +647,9 @@ class Commands(discord.Cog, name="Commands"): choices=["default", "compact", "tree_summarize"], ) async def query( - self, ctx: discord.ApplicationContext, query: str, response_mode: str + self, ctx: discord.ApplicationContext, query: str, nodes:int, response_mode: str ): - await self.index_cog.query_command(ctx, query, response_mode) + await self.index_cog.query_command(ctx, query, nodes, response_mode) # # DALLE commands diff --git a/cogs/index_service_cog.py b/cogs/index_service_cog.py index ef0b4a2..8de367b 100644 --- a/cogs/index_service_cog.py +++ b/cogs/index_service_cog.py @@ -126,7 +126,7 @@ class IndexService(discord.Cog, name="IndexService"): await ctx.defer(ephemeral=True) await self.index_handler.load_index(ctx, index, server, user_api_key) - async def query_command(self, ctx, query, response_mode): + async def query_command(self, ctx, query, nodes, response_mode): """Command handler to query your index""" user_api_key = None if USER_INPUT_API_KEYS: @@ -137,7 +137,7 @@ class IndexService(discord.Cog, name="IndexService"): return await ctx.defer() - await self.index_handler.query(ctx, query, response_mode, user_api_key) + await self.index_handler.query(ctx, query, response_mode, nodes, user_api_key) async def compose_command(self, ctx, name): """Command handler to compose from your index""" diff --git a/models/index_model.py b/models/index_model.py index 21737d3..0eb0904 100644 --- a/models/index_model.py +++ b/models/index_model.py @@ -13,6 +13,7 @@ from langchain import OpenAI from gpt_index.readers import YoutubeTranscriptReader from gpt_index.readers.schema.base import Document + from gpt_index import ( GPTSimpleVectorIndex, SimpleDirectoryReader, @@ -25,6 +26,7 @@ from gpt_index import ( MockLLMPredictor, LLMPredictor, QueryConfig, + PromptHelper, IndexStructType, ) from gpt_index.readers.web import DEFAULT_WEBSITE_EXTRACTOR @@ -36,14 +38,15 @@ from services.environment_service import EnvService, app_root_path SHORT_TO_LONG_CACHE = {} -def get_and_query(user_id, index_storage, query, response_mode, llm_predictor): +def get_and_query(user_id, index_storage, query, response_mode, nodes, llm_predictor): index: [GPTSimpleVectorIndex, ComposableGraph] = index_storage[ user_id ].get_index_or_throw() + prompthelper = PromptHelper(4096, 500, 20) if isinstance(index, GPTTreeIndex): - response = index.query(query, verbose=True, child_branch_factor=2, llm_predictor=llm_predictor) + response = index.query(query, verbose=True, child_branch_factor=2, llm_predictor=llm_predictor, prompt_helper=prompthelper) else: - response = index.query(query, response_mode=response_mode, verbose=True, llm_predictor=llm_predictor) + response = index.query(query, response_mode=response_mode, verbose=True, llm_predictor=llm_predictor, similarity_top_k=nodes, prompt_helper=prompthelper) return response @@ -308,7 +311,10 @@ class Index_handler: for doc_id in [docmeta for docmeta in _index.docstore.docs.keys()] if isinstance(_index.docstore.get_document(doc_id), Document) ] - tree_index = GPTTreeIndex(documents=documents) + llm_predictor = LLMPredictor(llm=OpenAI(model_name="text-davinci-003")) + tree_index = GPTTreeIndex(documents=documents, llm_predictor=llm_predictor) + print("The last token usage was ", llm_predictor.last_token_usage) + await self.usage_service.update_usage(llm_predictor.last_token_usage) # Now we have a list of tree indexes, we can compose them if not name: @@ -369,7 +375,7 @@ class Index_handler: traceback.print_exc() async def query( - self, ctx: discord.ApplicationContext, query: str, response_mode, user_api_key + self, ctx: discord.ApplicationContext, query: str, response_mode, nodes, user_api_key ): if not user_api_key: os.environ["OPENAI_API_KEY"] = self.openai_key @@ -381,7 +387,7 @@ class Index_handler: response = await self.loop.run_in_executor( None, partial( - get_and_query, ctx.user.id, self.index_storage, query, response_mode, llm_predictor + get_and_query, ctx.user.id, self.index_storage, query, response_mode, nodes, llm_predictor ), ) print("The last token usage was ", llm_predictor.last_token_usage) diff --git a/services/usage_service.py b/services/usage_service.py index 53fec35..64bfb76 100644 --- a/services/usage_service.py +++ b/services/usage_service.py @@ -18,7 +18,7 @@ class UsageService: tokens_used = int(tokens_used) price = (tokens_used / 1000) * 0.02 usage = await self.get_usage() - print("The current usage is " + str(usage) + " credits") + print(f"Cost -> Old: {str(usage)} | New: {str(usage + float(price))}, used {str(float(price))} credits") # Do the same as above but with aiofiles async with aiofiles.open(self.usage_file_path, "w") as f: await f.write(str(usage + float(price))) From 55fddbc37b3a64ea6b6c0b1d676f3fdd89ebb2ff Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Sun, 5 Feb 2023 13:28:29 +0000 Subject: [PATCH 4/6] Format Python code with psf/black push --- cogs/commands.py | 12 ++++++--- models/autocomplete_model.py | 1 - models/index_model.py | 48 ++++++++++++++++++++++++++++++------ services/usage_service.py | 4 ++- 4 files changed, 52 insertions(+), 13 deletions(-) diff --git a/cogs/commands.py b/cogs/commands.py index 903bba9..159cfd1 100644 --- a/cogs/commands.py +++ b/cogs/commands.py @@ -543,7 +543,9 @@ class Commands(discord.Cog, name="Commands"): required=False, autocomplete=File_autocompleter.get_server_indexes, ) - async def load_index(self, ctx: discord.ApplicationContext, user_index: str, server_index: str): + async def load_index( + self, ctx: discord.ApplicationContext, user_index: str, server_index: str + ): await self.index_cog.load_index_command(ctx, user_index, server_index) @add_to_group("index") @@ -617,7 +619,7 @@ class Commands(discord.Cog, name="Commands"): name="discord_backup", description="Save an index made from the whole server", guild_ids=ALLOWED_GUILDS, - checks=[Check.check_admin_roles(), Check.check_index_roles()] + checks=[Check.check_admin_roles(), Check.check_index_roles()], ) @discord.guild_only() async def discord_backup(self, ctx: discord.ApplicationContext): @@ -647,7 +649,11 @@ class Commands(discord.Cog, name="Commands"): choices=["default", "compact", "tree_summarize"], ) async def query( - self, ctx: discord.ApplicationContext, query: str, nodes:int, response_mode: str + self, + ctx: discord.ApplicationContext, + query: str, + nodes: int, + response_mode: str, ): await self.index_cog.query_command(ctx, query, nodes, response_mode) diff --git a/models/autocomplete_model.py b/models/autocomplete_model.py index 7a38481..6e2cc2d 100644 --- a/models/autocomplete_model.py +++ b/models/autocomplete_model.py @@ -167,7 +167,6 @@ class File_autocompleter: except Exception: return ["No user indexes found, add an index"] - async def get_server_indexes(ctx: discord.AutocompleteContext): """get all files in the indexes folder""" try: diff --git a/models/index_model.py b/models/index_model.py index 0eb0904..50068b5 100644 --- a/models/index_model.py +++ b/models/index_model.py @@ -44,9 +44,22 @@ def get_and_query(user_id, index_storage, query, response_mode, nodes, llm_predi ].get_index_or_throw() prompthelper = PromptHelper(4096, 500, 20) if isinstance(index, GPTTreeIndex): - response = index.query(query, verbose=True, child_branch_factor=2, llm_predictor=llm_predictor, prompt_helper=prompthelper) + response = index.query( + query, + verbose=True, + child_branch_factor=2, + llm_predictor=llm_predictor, + prompt_helper=prompthelper, + ) else: - response = index.query(query, response_mode=response_mode, verbose=True, llm_predictor=llm_predictor, similarity_top_k=nodes, prompt_helper=prompthelper) + response = index.query( + query, + response_mode=response_mode, + verbose=True, + llm_predictor=llm_predictor, + similarity_top_k=nodes, + prompt_helper=prompthelper, + ) return response @@ -273,7 +286,9 @@ class Index_handler: await ctx.respond("Failed to set index") traceback.print_exc() - async def load_index(self, ctx: discord.ApplicationContext, index, server, user_api_key): + async def load_index( + self, ctx: discord.ApplicationContext, index, server, user_api_key + ): if not user_api_key: os.environ["OPENAI_API_KEY"] = self.openai_key else: @@ -281,9 +296,13 @@ class Index_handler: try: if server: - index_file = EnvService.find_shared_file(f"indexes/{ctx.guild.id}/{index}") + index_file = EnvService.find_shared_file( + f"indexes/{ctx.guild.id}/{index}" + ) else: - index_file = EnvService.find_shared_file(f"indexes/{ctx.user.id}/{index}") + index_file = EnvService.find_shared_file( + f"indexes/{ctx.user.id}/{index}" + ) index = await self.loop.run_in_executor( None, partial(self.index_load_file, index_file) ) @@ -361,7 +380,9 @@ class Index_handler: index = await self.loop.run_in_executor( None, partial(self.index_discord, document) ) - Path(app_root_path() / "indexes" / str(ctx.guild.id)).mkdir(parents=True, exist_ok=True) + Path(app_root_path() / "indexes" / str(ctx.guild.id)).mkdir( + parents=True, exist_ok=True + ) index.save_to_disk( app_root_path() / "indexes" @@ -375,7 +396,12 @@ class Index_handler: traceback.print_exc() async def query( - self, ctx: discord.ApplicationContext, query: str, response_mode, nodes, user_api_key + self, + ctx: discord.ApplicationContext, + query: str, + response_mode, + nodes, + user_api_key, ): if not user_api_key: os.environ["OPENAI_API_KEY"] = self.openai_key @@ -387,7 +413,13 @@ class Index_handler: response = await self.loop.run_in_executor( None, partial( - get_and_query, ctx.user.id, self.index_storage, query, response_mode, nodes, llm_predictor + get_and_query, + ctx.user.id, + self.index_storage, + query, + response_mode, + nodes, + llm_predictor, ), ) print("The last token usage was ", llm_predictor.last_token_usage) diff --git a/services/usage_service.py b/services/usage_service.py index 64bfb76..2d43c86 100644 --- a/services/usage_service.py +++ b/services/usage_service.py @@ -18,7 +18,9 @@ class UsageService: tokens_used = int(tokens_used) price = (tokens_used / 1000) * 0.02 usage = await self.get_usage() - print(f"Cost -> Old: {str(usage)} | New: {str(usage + float(price))}, used {str(float(price))} credits") + print( + f"Cost -> Old: {str(usage)} | New: {str(usage + float(price))}, used {str(float(price))} credits" + ) # Do the same as above but with aiofiles async with aiofiles.open(self.usage_file_path, "w") as f: await f.write(str(usage + float(price))) From cb8b0242ef85d12d5e3d4c99bfa3b5d0c8120189 Mon Sep 17 00:00:00 2001 From: Hikari Haru Date: Sun, 5 Feb 2023 14:28:52 +0100 Subject: [PATCH 5/6] Bump version Signed-off-by: Hikari Haru --- gpt3discord.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpt3discord.py b/gpt3discord.py index c6b9e67..55d9b40 100644 --- a/gpt3discord.py +++ b/gpt3discord.py @@ -31,7 +31,7 @@ from services.environment_service import EnvService from models.openai_model import Model -__version__ = "10.0.0" +__version__ = "10.1.0" PID_FILE = Path("bot.pid") From a5ea3f7d3ee877e066e516dba3555d3d466ebda4 Mon Sep 17 00:00:00 2001 From: Hikari Haru Date: Sun, 5 Feb 2023 14:44:30 +0100 Subject: [PATCH 6/6] Update Dockerfile Signed-off-by: Hikari Haru --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5e7b98a..dc2e048 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN mkdir /install /src WORKDIR /install RUN pip install --target="/install" --upgrade pip setuptools wheel RUN pip install --target="/install" --upgrade setuptools_rust -RUN pip install --target="/install" --upgrade torch==1.9.1+cpu torchvision==0.10.1+cpu -f https://download.pytorch.org/whl/torch_stable.html +RUN pip install --target="/install" --upgrade torch==1.9.0+cpu torchvision==0.10.0+cpu -f https://download.pytorch.org/whl/torch_stable.html RUN pip install --target="/install" --upgrade git+https://github.com/openai/whisper.git COPY requirements.txt /install RUN pip install --target="/install" -r requirements.txt