mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-05 12:40:38 +08:00
[fix] syntax error and some typing issue in py38
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
|
||||
"""
|
||||
from typing import List, Dict
|
||||
from dataclasses import dataclass
|
||||
from typing import Optional, Union
|
||||
|
||||
@@ -35,7 +36,7 @@ class RankGenCollator:
|
||||
max_length: Optional[int] = None
|
||||
max_examples: Optional[int] = None
|
||||
|
||||
def __call__(self, batch: list[dict[str, str]]) -> dict[str, torch.Tensor]:
|
||||
def __call__(self, batch: List[Dict[str, str]]) -> Dict[str, torch.Tensor]:
|
||||
prefixes = []
|
||||
better_answers = []
|
||||
worse_answers = []
|
||||
|
||||
@@ -137,7 +137,6 @@ if __name__ == "__main__":
|
||||
output_dir=f"{model_name}-finetuned",
|
||||
num_train_epochs=training_conf["num_train_epochs"],
|
||||
warmup_steps=500,
|
||||
loss_function=training_conf["loss"],
|
||||
learning_rate=training_conf["learning_rate"],
|
||||
# half_precision_backend="apex",
|
||||
fp16=training_conf["fp16"],
|
||||
|
||||
Reference in New Issue
Block a user