From 4550842af80ba4c526034b3319c322cad565cb89 Mon Sep 17 00:00:00 2001 From: PineApple777 Date: Mon, 21 Oct 2024 13:51:43 +0900 Subject: [PATCH 1/2] bugfix generic type in python 3.8 --- src/huggingface_hub/commands/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/huggingface_hub/commands/user.py b/src/huggingface_hub/commands/user.py index c1498c918d..9e7ece6573 100644 --- a/src/huggingface_hub/commands/user.py +++ b/src/huggingface_hub/commands/user.py @@ -36,7 +36,7 @@ import subprocess from argparse import _SubParsersAction -from typing import Optional +from typing import Optional, List from requests.exceptions import HTTPError @@ -200,7 +200,7 @@ def _select_token_name(self) -> Optional[str]: except ValueError: print("Invalid input. Please enter a number or 'q' to quit.") - def _select_token_name_tui(self, token_names: list[str]) -> Optional[str]: + def _select_token_name_tui(self, token_names: List[str]) -> Optional[str]: choices = [Choice(token_name, name=token_name) for token_name in token_names] try: return inquirer.select( From ab1e4a28221e784d70724586b28b9e8f10b74b86 Mon Sep 17 00:00:00 2001 From: Celina Hanouti Date: Mon, 21 Oct 2024 11:14:26 +0200 Subject: [PATCH 2/2] run style --- src/huggingface_hub/commands/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/huggingface_hub/commands/user.py b/src/huggingface_hub/commands/user.py index 9e7ece6573..9741a219f1 100644 --- a/src/huggingface_hub/commands/user.py +++ b/src/huggingface_hub/commands/user.py @@ -36,7 +36,7 @@ import subprocess from argparse import _SubParsersAction -from typing import Optional, List +from typing import List, Optional from requests.exceptions import HTTPError