Skip to content

Commit

Permalink
fix: linter issues based on superlinter rules!
Browse files Browse the repository at this point in the history
  • Loading branch information
amindadgar committed Dec 28, 2023
1 parent a467be0 commit e94bc8a
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion celery_app/tasks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from celery_app.server import app
from celery_app.job_send import job_send
from celery_app.server import app

# TODO: Write tasks that match our requirements

Expand Down
12 changes: 5 additions & 7 deletions discord_query.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from retrievers.forum_summary_retriever import (
ForumBasedSummaryRetriever,
)
from llama_index import QueryBundle
from llama_index.vector_stores import ExactMatchFilter, FilterCondition, MetadataFilters
from retrievers.forum_summary_retriever import ForumBasedSummaryRetriever
from retrievers.process_dates import process_dates
from retrievers.utils.load_hyperparams import load_hyperparams
from tc_hivemind_backend.embeddings.cohere import CohereEmbedding
from tc_hivemind_backend.pg_vector_access import PGVectorAccess
from llama_index import QueryBundle
from llama_index.vector_stores import ExactMatchFilter, FilterCondition, MetadataFilters


def query_discord(
Expand Down Expand Up @@ -140,8 +138,8 @@ def query_discord_auto_filter(
response = query_discord(
community_id=community_id,
query=query,
thread_names=threads,
channel_names=channels,
thread_names=list(threads),
channel_names=list(channels),
days=dates_modified,
)
return response
3 changes: 1 addition & 2 deletions retrievers/forum_summary_retriever.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from llama_index.embeddings import BaseEmbedding
from retrievers.summary_retriever_base import BaseSummarySearch
from tc_hivemind_backend.embeddings.cohere import CohereEmbedding

from llama_index.embeddings import BaseEmbedding


class ForumBasedSummaryRetriever(BaseSummarySearch):
def __init__(
Expand Down
5 changes: 2 additions & 3 deletions retrievers/summary_retriever_base.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from tc_hivemind_backend.embeddings.cohere import CohereEmbedding

from tc_hivemind_backend.pg_vector_access import PGVectorAccess
from llama_index import VectorStoreIndex
from llama_index.embeddings import BaseEmbedding
from llama_index.indices.query.schema import QueryBundle
from llama_index.schema import NodeWithScore
from tc_hivemind_backend.embeddings.cohere import CohereEmbedding
from tc_hivemind_backend.pg_vector_access import PGVectorAccess


class BaseSummarySearch:
Expand Down
4 changes: 1 addition & 3 deletions tests/unit/test_discord_summary_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
from unittest import TestCase
from unittest.mock import MagicMock

from retrievers.forum_summary_retriever import (
ForumBasedSummaryRetriever,
)
from dateutil import parser
from llama_index import Document, MockEmbedding, ServiceContext, VectorStoreIndex
from retrievers.forum_summary_retriever import ForumBasedSummaryRetriever


class TestDiscordSummaryRetriever(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_summary_retriever_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from unittest import TestCase
from unittest.mock import MagicMock

from retrievers.summary_retriever_base import BaseSummarySearch
from llama_index import Document, MockEmbedding, ServiceContext, VectorStoreIndex
from llama_index.schema import NodeWithScore
from retrievers.summary_retriever_base import BaseSummarySearch


class TestSummaryRetrieverBase(TestCase):
Expand Down
5 changes: 2 additions & 3 deletions worker.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from celery_app.tasks import add
from tc_messageBroker import RabbitMQ
from tc_messageBroker.rabbit_mq.event import Event
from tc_messageBroker.rabbit_mq.queue import Queue

from celery_app.tasks import add


# TODO: Update according to our requirements
def do_something(recieved_data):
message = f"Calculation Results:"
message = "Calculation Results:"
print(message)
print(f"recieved_data: {recieved_data}")
add.delay(20, 14)
Expand Down

0 comments on commit e94bc8a

Please sign in to comment.