Commit 4b0c49a1 authored by Konrad's avatar Konrad
Browse files

linting backward compatibility fix

parent 6f76522a
......@@ -3,7 +3,7 @@ import hashlib
import json
import logging
import os
from typing import List, Optional, Tuple, Type, TypeVar
from typing import Dict, List, Optional, Tuple, Type, TypeVar
import transformers
from sqlitedict import SqliteDict
......@@ -114,7 +114,7 @@ class LM(abc.ABC):
"""
pass
def apply_chat_template(self, chat_history: list[dict[str, str]]) -> str:
def apply_chat_template(self, chat_history: List[Dict[str, str]]) -> str:
"""
Defines how to transform few-shot examples provided as chat history into a format that can be used as input to the LM.
......
......@@ -975,7 +975,7 @@ class ConfigurableTask(Task):
@staticmethod
def append_target_question(
labeled_examples: list[dict[str, str]],
labeled_examples: List[Dict[str, str]],
question: str,
fewshot_as_multiturn: bool = False,
) -> None:
......
......@@ -2,7 +2,7 @@ import copy
import os
from datetime import timedelta
from pathlib import Path
from typing import List, Literal, Optional, Tuple, Union
from typing import Dict, List, Literal, Optional, Tuple, Union
import torch
import torch.nn.functional as F
......@@ -1290,7 +1290,7 @@ class HFLM(TemplateLM):
return res
def apply_chat_template(self, chat_history: list[dict[str, str]]) -> str:
def apply_chat_template(self, chat_history: List[Dict[str, str]]) -> str:
"""
Method to apply a chat template to a list of chat history between user and model.
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment