-
Notifications
You must be signed in to change notification settings - Fork 103
[Package] Changing source directory name #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import Union, List, Tuple, Dict | ||
|
||
|
||
class Finetune(ABC): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
|
||
import bitsandbytes as bnb | ||
from datasets import Dataset | ||
from accelerate import Accelerator | ||
from transformers import ( | ||
AutoTokenizer, | ||
AutoModelForCausalLM, | ||
|
@@ -23,10 +22,10 @@ | |
from rich.console import Console | ||
|
||
|
||
from src.pydantic_models.config_model import Config | ||
from src.utils.save_utils import DirectoryHelper | ||
from src.finetune.finetune import Finetune | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused imports. But I agree this should be separate. |
||
from src.ui.rich_ui import RichUI | ||
from llmtune.pydantic_models.config_model import Config | ||
from llmtune.utils.save_utils import DirectoryHelper | ||
from llmtune.finetune.generics import Finetune | ||
from llmtune.ui.rich_ui import RichUI | ||
|
||
|
||
class LoRAFinetune(Finetune): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import Union, List, Tuple, Dict | ||
|
||
|
||
class Inference(ABC): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,20 +4,17 @@ | |
import csv | ||
|
||
from transformers import TextIteratorStreamer | ||
from rich.console import Console | ||
from rich.table import Table | ||
from rich.live import Live | ||
Comment on lines
-7
to
-9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same question: I would keep renaming as one change and fixing rich as another PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed |
||
from rich.text import Text | ||
from datasets import Dataset | ||
from transformers import AutoTokenizer, BitsAndBytesConfig | ||
from peft import AutoPeftModelForCausalLM | ||
import torch | ||
|
||
|
||
from src.pydantic_models.config_model import Config | ||
from src.utils.save_utils import DirectoryHelper | ||
from src.inference.inference import Inference | ||
from src.ui.rich_ui import RichUI | ||
from llmtune.pydantic_models.config_model import Config | ||
from llmtune.utils.save_utils import DirectoryHelper | ||
from llmtune.inference.generics import Inference | ||
from llmtune.ui.rich_ui import RichUI | ||
|
||
|
||
# TODO: Add type hints please! | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import Union, List, Tuple, Dict | ||
import pandas as pd | ||
from src.ui.rich_ui import RichUI | ||
from llmtune.ui.rich_ui import RichUI | ||
import statistics | ||
from src.qa.qa_tests import * | ||
from llmtune.qa.qa_tests import * | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please. do not do this. import only what you need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
|
||
class LLMQaTest(ABC): | ||
|
@@ -18,6 +18,7 @@ def get_metric( | |
) -> Union[float, int, bool]: | ||
pass | ||
|
||
|
||
class QaTestRegistry: | ||
registry = {} | ||
|
||
|
@@ -27,18 +28,22 @@ def inner_wrapper(wrapped_class): | |
for name in names: | ||
cls.registry[name] = wrapped_class | ||
return wrapped_class | ||
|
||
return inner_wrapper | ||
|
||
@classmethod | ||
@classmethod | ||
def create_tests_from_list(cls, test_name: str) -> List[LLMQaTest]: | ||
return [cls.create_test(test) for test in test_names] | ||
|
||
class LLMTestSuite(): | ||
def __init__(self, | ||
tests:List[LLMQaTest], | ||
prompts:List[str], | ||
ground_truths:List[str], | ||
model_preds:List[str]) -> None: | ||
|
||
class LLMTestSuite: | ||
def __init__( | ||
self, | ||
tests: List[LLMQaTest], | ||
prompts: List[str], | ||
ground_truths: List[str], | ||
model_preds: List[str], | ||
) -> None: | ||
|
||
self.tests = tests | ||
self.prompts = prompts | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we remove this in this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused imports. But I agree this should be separate.