mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-12-17 04:10:36 +08:00
[misc] upgrade format to py39 (#7256)
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
|
||||
import os
|
||||
import random
|
||||
from typing import Dict, List
|
||||
|
||||
import pytest
|
||||
from datasets import load_dataset
|
||||
@@ -43,7 +42,7 @@ TRAIN_ARGS = {
|
||||
}
|
||||
|
||||
|
||||
def _convert_sharegpt_to_openai(messages: List[Dict[str, str]]) -> List[Dict[str, str]]:
|
||||
def _convert_sharegpt_to_openai(messages: list[dict[str, str]]) -> list[dict[str, str]]:
|
||||
role_mapping = {"human": "user", "gpt": "assistant", "system": "system"}
|
||||
new_messages = []
|
||||
for message in messages:
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from typing import Tuple
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -31,5 +30,5 @@ from llamafactory.data.processor.processor_utils import infer_seqlen
|
||||
((10, 10, 1000), (10, 10)),
|
||||
],
|
||||
)
|
||||
def test_infer_seqlen(test_input: Tuple[int, int, int], test_output: Tuple[int, int]):
|
||||
def test_infer_seqlen(test_input: tuple[int, int, int], test_output: tuple[int, int]):
|
||||
assert test_output == infer_seqlen(*test_input)
|
||||
|
||||
Reference in New Issue
Block a user