Skip to content

Commit

Permalink
Merge pull request #10 from krflorian/feature/stackoverflow
Browse files Browse the repository at this point in the history
refactoring
  • Loading branch information
krflorian authored Mar 25, 2024
2 parents 75fbcd4 + fbeb89c commit 91cd03b
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from pydantic import BaseModel, Field
from sentence_transformers import SentenceTransformer, CrossEncoder

from src.objects import Card, Document
from src.vector_db import VectorDB
from src.util import load_config
from src.hallucination import validate_answer
from objects import Card, Document
from vector_db import VectorDB
from util import load_config
from hallucination import validate_answer

config: dict = load_config(Path("configs/config.yaml"))
vector_model: SentenceTransformer = SentenceTransformer(
Expand Down
4 changes: 2 additions & 2 deletions src/etl/create_rules_db.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# %%
from src.etl.extractors import (
from etl.extractors import (
RulesGuruExtractor,
ComprehensiveRulesExtractor,
StackExchangeExtractor,
WikipediaExtractor,
)
from src.etl.loaders import DocumentLoader
from etl.loaders import DocumentLoader
from pathlib import Path
import logging

Expand Down
2 changes: 1 addition & 1 deletion src/etl/extractors/comprehensive_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pathlib import Path
from datetime import datetime

from src.objects import Document
from objects import Document
from .data_extractor import DataExtractor


Expand Down
2 changes: 1 addition & 1 deletion src/etl/extractors/data_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
import logging

from src.objects import Document
from objects import Document


class DataExtractor(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion src/etl/extractors/rulesguru.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pydantic import Field
from pathlib import Path

from src.objects import Document
from objects import Document
from .data_extractor import DataExtractor


Expand Down
2 changes: 1 addition & 1 deletion src/etl/extractors/stackexchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import logging

from .data_extractor import DataExtractor
from src.objects import Document
from objects import Document


class StackExchangeExtractor(DataExtractor):
Expand Down
4 changes: 2 additions & 2 deletions src/etl/loaders/document_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from pathlib import Path
from sentence_transformers import SentenceTransformer

from src.objects import Document
from src.vector_db import VectorDB
from objects import Document
from vector_db import VectorDB


class DocumentLoader(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pathlib import Path
from sentence_transformers import SentenceTransformer

from src.util import load_config
from util import load_config


@pytest.fixture(scope="session")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_card_db.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from src.vector_db import VectorDB
from vector_db import VectorDB


@pytest.fixture(scope="module")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_rules_db.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from src.vector_db import VectorDB
from vector_db import VectorDB


@pytest.fixture(scope="module")
Expand Down

0 comments on commit 91cd03b

Please sign in to comment.