Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
motin committed Jan 25, 2024
1 parent 5ca48c0 commit a9cd68f
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@

# for exponential backoff
import litellm
from tenacity import before_sleep_log, retry, stop_after_attempt, wait_random

from gpt4_evaluator_config import GPT4EvaluatorConfig
from tenacity import before_sleep_log, retry, stop_after_attempt, wait_random
from yival.evaluators.base_evaluator import BaseEvaluator
from yival.schemas.evaluator_config import (
EvaluatorOutput,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from dataclasses import asdict, dataclass, field
from typing import Any, Dict, List, Optional, Union

from yival.schemas.evaluator_config import EvaluatorConfig, EvaluatorType


Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# encoding: utf-8

import random
from http import HTTPStatus

import dashscope
from dashscope import Generation
from tenacity import (
retry,
retry_if_exception_type,
retry_if_not_result,
stop_after_attempt,
)
from http import HTTPStatus
import dashscope
from dashscope import Generation

from lib.config import read_config
import random


def response_is_ok(response):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import litellm
from litellm import completion
from llms.alibaba_complete import llm_complete as alibaba_llm_complete
from llms.palm_completion import safety_settings
from model_config_wrapper import ModelConfigWrapper
from yival.logger.token_logger import TokenLogger
from yival.schemas.experiment_config import MultimodalOutput
from yival.schemas.model_configs import Response
from yival.states.experiment_state import ExperimentState
from yival.wrappers.string_wrapper import StringWrapper
from model_config_wrapper import ModelConfigWrapper
from llms.alibaba_complete import llm_complete as alibaba_llm_complete
from llms.palm_completion import safety_settings
import litellm
from litellm import completion

# load env vars
from lib.config import read_config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from dataclasses import asdict, dataclass, field
from typing import Any, Iterator, List, Optional

from model_config_variation_generator_config import ModelConfigVariationGeneratorConfig

# from yival.schemas.experiment_config import WrapperVariation
# ^ this is not working for dict so I write my own version

from yival.variation_generators.base_variation_generator import BaseVariationGenerator

from model_config_variation_generator_config import ModelConfigVariationGeneratorConfig


@dataclass
class WrapperVariation:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import dataclass
from yival.schemas.varation_generator_configs import BaseVariationGeneratorConfig
from typing import Any, Dict, List, Optional

from typing import Optional, List, Dict, Any
from yival.schemas.varation_generator_configs import BaseVariationGeneratorConfig


@dataclass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Optional, Dict, Any
from typing import Any, Dict, Optional

from model_config_wrapper_config import ModelConfigWrapperConfig
from yival.wrappers.base_wrapper import BaseWrapper
from yival.experiment.experiment_runner import ExperimentState
from yival.wrappers.base_wrapper import BaseWrapper


class ModelConfigWrapper(BaseWrapper):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from yival.data.base_reader import BaseReader
from yival.schemas.common_structures import InputData

from lib.pilot.helpers import read_ai_eval_spreadsheet, get_questions
from lib.pilot.helpers import get_questions, read_ai_eval_spreadsheet


class QuestionReader(BaseReader):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dataclasses import asdict, dataclass

from yival.data.base_reader import BaseReaderConfig


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pandas as pd
from lib.pilot.helpers import read_ai_eval_spreadsheet, get_questions

from lib.pilot.helpers import get_questions, read_ai_eval_spreadsheet

correctness_map = {1: "Correct", 2: "Wrong", 3: "Very Wrong"}
output_file = "../data/questions.csv"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import os
from datetime import datetime
from typing import Any, Dict

import yaml

from lib.ai_eval_spreadsheet.wrapper import AiEvalData
from lib.pilot.helpers import (
read_ai_eval_spreadsheet,
get_metrics,
get_model_configs,
get_prompt_variants,
load_model_parameters,
read_ai_eval_spreadsheet,
)
from lib.ai_eval_spreadsheet.wrapper import AiEvalData
from typing import Dict, Any


# to make pyyaml's dumper generate good looking strings
Expand Down
4 changes: 2 additions & 2 deletions automation-api/yival_experiments/scripts/generate_result.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os.path as osp
from glob import glob
import pandas as pd
import pickle
from glob import glob

import pandas as pd
from yival.experiment.experiment_runner import Experiment

# all Yival experiment results are exported into pickle files.
Expand Down

0 comments on commit a9cd68f

Please sign in to comment.