Skip to content

Commit

Permalink
Format Python code with psf/black push
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions authored and github-actions committed Jan 10, 2023
1 parent 413c1ae commit ead677d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion gpt3discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@
PINECONE_INDEX = "conversation-embeddings"
if PINECONE_INDEX not in pinecone.list_indexes():
print("Creating pinecone index. Please wait...")
pinecone.create_index('conversation-embeddings', dimension=1536, metric='dotproduct', pod_type='s1')
pinecone.create_index(
"conversation-embeddings",
dimension=1536,
metric="dotproduct",
pod_type="s1",
)

pinecone_service = PineconeService(pinecone.Index(PINECONE_INDEX))
print("Got the pinecone service")
Expand Down
6 changes: 5 additions & 1 deletion models/autocomplete_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ async def get_value(
"summarize_threshold": [str(num) for num in range(800, 3500, 50)],
}
if ctx.options["parameter"] in values.keys():
return [value for value in values[ctx.options["parameter"]] if value.startswith(ctx.value.lower())]
return [
value
for value in values[ctx.options["parameter"]]
if value.startswith(ctx.value.lower())
]
else:
await ctx.interaction.response.defer() # defer so the autocomplete in int values doesn't error but rather just says not found
return []
Expand Down

0 comments on commit ead677d

Please sign in to comment.