From c35d9439cbeaf7a88572d3e9a9c96b3f0cc97f26 Mon Sep 17 00:00:00 2001 From: yuxuan-lou Date: Wed, 29 Mar 2023 23:07:33 +0800 Subject: [PATCH 1/2] [NFC] polish colossalai/context/random/__init__.py code style --- colossalai/context/random/__init__.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/colossalai/context/random/__init__.py b/colossalai/context/random/__init__.py index 422c3676c09d..d64b993257c1 100644 --- a/colossalai/context/random/__init__.py +++ b/colossalai/context/random/__init__.py @@ -1,5 +1,16 @@ -from ._helper import (seed, set_mode, with_seed, add_seed, get_seeds, get_states, get_current_mode, set_seed_states, - sync_states, moe_set_seed, reset_seeds) +from ._helper import ( + add_seed, + get_current_mode, + get_seeds, + get_states, + moe_set_seed, + reset_seeds, + seed, + set_mode, + set_seed_states, + sync_states, + with_seed, +) __all__ = [ 'seed', 'set_mode', 'with_seed', 'add_seed', 'get_seeds', 'get_states', 'get_current_mode', 'set_seed_states', From 3212efcac589c3235913ce78fde45317bda0aaee Mon Sep 17 00:00:00 2001 From: yuxuan-lou Date: Tue, 18 Jul 2023 20:50:36 +0800 Subject: [PATCH 2/2] [NFC] polish applications/Chat/coati/models/utils.py code style --- applications/Chat/coati/models/utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/applications/Chat/coati/models/utils.py b/applications/Chat/coati/models/utils.py index b9f15f894a1f..772bfc32982a 100644 --- a/applications/Chat/coati/models/utils.py +++ b/applications/Chat/coati/models/utils.py @@ -46,10 +46,7 @@ def log_probs_from_logits(logits: torch.Tensor, labels: torch.Tensor) -> torch.T return log_probs_labels.squeeze(-1) -def calc_action_log_probs(output: torch.Tensor, - sequences: torch.LongTensor, - num_actions: int - ) -> torch.Tensor: +def calc_action_log_probs(output: torch.Tensor, sequences: torch.LongTensor, num_actions: int) -> torch.Tensor: """Calculate action log probs. Args: