Skip to content

Commit

Permalink
WIP: finish rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
NickyHavoc committed Feb 21, 2024
1 parent df55c13 commit e138315
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 176 deletions.
2 changes: 2 additions & 0 deletions src/intelligence_layer/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
from .explain import Explain as Explain
from .explain import ExplainInput as ExplainInput
from .explain import ExplainOutput as ExplainOutput
from .instruct import Instruct as Instruct
from .instruct import InstructInput as InstructInput
from .intelligence_app import (
AuthenticatedIntelligenceApp as AuthenticatedIntelligenceApp,
)
Expand Down
10 changes: 5 additions & 5 deletions src/intelligence_layer/evaluation/argilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Question,
RecordData,
)
from intelligence_layer.core import Input, InstructInput, Output, PromptOutput
from intelligence_layer.core import CompleteOutput, Input, InstructInput, Output
from intelligence_layer.evaluation import Aggregator
from intelligence_layer.evaluation.accumulator import MeanAccumulator
from intelligence_layer.evaluation.base_logic import AggregationLogic, EvaluationLogic
Expand Down Expand Up @@ -200,7 +200,7 @@ def aggregate(


class InstructComparisonArgillaEvaluationLogic(
ArgillaEvaluationLogic[InstructInput, PromptOutput, None]
ArgillaEvaluationLogic[InstructInput, CompleteOutput, None]
):
def __init__(
self,
Expand All @@ -215,11 +215,11 @@ def __init__(
def _to_record(
self,
example: Example[InstructInput, None],
*outputs: SuccessfulExampleOutput[PromptOutput],
*outputs: SuccessfulExampleOutput[CompleteOutput],
) -> RecordDataSequence:
def create_record_data(
first: SuccessfulExampleOutput[PromptOutput],
second: SuccessfulExampleOutput[PromptOutput],
first: SuccessfulExampleOutput[CompleteOutput],
second: SuccessfulExampleOutput[CompleteOutput],
) -> RecordData:
if random.choice([True, False]):
first, second = second, first
Expand Down

This file was deleted.

10 changes: 8 additions & 2 deletions src/intelligence_layer/use_cases/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,21 @@
AggregatedSummarizeEvaluation as AggregatedSummarizeEvaluation,
)
from .summarize.summarize import (
LongContextSummarizeEvaluator as LongContextSummarizeEvaluator,
LongContextSummarizeAggregationLogic as LongContextSummarizeAggregationLogic,
)
from .summarize.summarize import (
LongContextSummarizeEvaluationLogic as LongContextSummarizeEvaluationLogic,
)
from .summarize.summarize import LongContextSummarizeInput as LongContextSummarizeInput
from .summarize.summarize import (
LongContextSummarizeOutput as LongContextSummarizeOutput,
)
from .summarize.summarize import PartialSummary as PartialSummary
from .summarize.summarize import (
SingleChunkSummarizeEvaluator as SingleChunkSummarizeEvaluator,
SingleChunkSummarizeAggregationLogic as SingleChunkSummarizeAggregationLogic,
)
from .summarize.summarize import (
SingleChunkSummarizeEvaluationLogic as SingleChunkSummarizeEvaluationLogic,
)
from .summarize.summarize import SingleChunkSummarizeInput as SingleChunkSummarizeInput
from .summarize.summarize import SummarizeEvaluation as SummarizeEvaluation
Expand Down
7 changes: 5 additions & 2 deletions tests/use_cases/summarize/test_summarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Aggregator,
DatasetRepository,
EvaluationRepository,
Evaluator,
Example,
InMemoryDatasetRepository,
InMemoryEvaluationRepository,
Expand All @@ -16,7 +17,9 @@
InMemoryAggregationRepository,
)
from intelligence_layer.use_cases import (
LongContextSummarizeEvaluator,
AggregatedSummarizeEvaluation,
LongContextSummarizeAggregationLogic,
LongContextSummarizeEvaluationLogic,
LongContextSummarizeInput,
LongContextSummarizeOutput,
SingleChunkSummarizeAggregationLogic,
Expand Down Expand Up @@ -60,7 +63,7 @@ def single_chunk_summarize_aggregator(
in_memory_evaluation_repository: InMemoryEvaluationRepository,
in_memory_aggregation_repository: InMemoryAggregationRepository,
single_chunk_summarize_aggregation_logic: SingleChunkSummarizeAggregationLogic,
) -> Aggregator[SummarizeEvaluation, AggregatedSummarizeEvaluation,]:
) -> Aggregator[SummarizeEvaluation, AggregatedSummarizeEvaluation]:
return Aggregator(
in_memory_evaluation_repository,
in_memory_aggregation_repository,
Expand Down

0 comments on commit e138315

Please sign in to comment.