Skip to content
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

Fix bitsandbytes h100 issue #93

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dalm/datasets/qa_gen/question_answer_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ def split_dataset(


def generate_qa_from_dataset(
dataset: Dataset, passage_column_name: str, title_column_name: str, sample_size: int, batch_size: int
dataset: Dataset, passage_column_name: str, title_column_name: str, sample_size: int, batch_size: int, load_in_8bit: bool = True
) -> DatasetDict:
logger.info(f"Generating question answer pairs with batch size: {batch_size}")
tokenizer = AutoTokenizer.from_pretrained(QA_MODEL)
model = AutoModelForSeq2SeqLM.from_pretrained(QA_MODEL, device_map="auto", load_in_8bit=True)
model = AutoModelForSeq2SeqLM.from_pretrained(QA_MODEL, device_map="auto", load_in_8bit=load_in_8bit)
# shuffle data
dataset.shuffle(seed=42)
# select a subset
Expand Down
2 changes: 1 addition & 1 deletion dalm/models/rag_e2e_base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(
) -> None:
super(AutoModelForRagE2E, self).__init__()

# Retriver initialization
# Retriever initialization
self.retriever_model = AutoModel.from_pretrained(
retriever_name,
quantization_config=AutoModelForRagE2E.__get_bnb_config()
Expand Down
Loading