From 45616a5c8f3d382cceb0219898d6d2f4d49112a7 Mon Sep 17 00:00:00 2001 From: Bhavya Bahl Date: Thu, 2 May 2024 22:38:47 +0000 Subject: [PATCH 1/2] Pick a slot from 0 to batch_size-1 --- run_interactive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_interactive.py b/run_interactive.py index c389d9cd..95d069dc 100644 --- a/run_interactive.py +++ b/run_interactive.py @@ -120,7 +120,7 @@ def main(argv): "[INST] <>\nYou are an AI assistant. You will be given a task. You must generate a detailed and long answer.\n<>\n\nContinue the following story.\n\nKay didn't have shoes that fit her feet properly. She only wore sneakers, because the \nChoose from: [I] shoes fitted badly. [II] sneakers fitted badly. [/INST]", ] for prompt in prompts: - slot = random.randint(0, _BATCH_SIZE.value) + slot = random.randint(0, _BATCH_SIZE.value-1) tokens, true_length = token_utils.tokenize_and_pad( prompt, vocab, is_bos=True ) From 35dec59561d0ef8645a4ba8149c88a42800dbc1d Mon Sep 17 00:00:00 2001 From: Bhavya Bahl Date: Thu, 2 May 2024 22:54:08 +0000 Subject: [PATCH 2/2] Fix pyink --- run_interactive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_interactive.py b/run_interactive.py index 95d069dc..df4aab89 100644 --- a/run_interactive.py +++ b/run_interactive.py @@ -120,7 +120,7 @@ def main(argv): "[INST] <>\nYou are an AI assistant. You will be given a task. You must generate a detailed and long answer.\n<>\n\nContinue the following story.\n\nKay didn't have shoes that fit her feet properly. She only wore sneakers, because the \nChoose from: [I] shoes fitted badly. [II] sneakers fitted badly. [/INST]", ] for prompt in prompts: - slot = random.randint(0, _BATCH_SIZE.value-1) + slot = random.randint(0, _BATCH_SIZE.value - 1) tokens, true_length = token_utils.tokenize_and_pad( prompt, vocab, is_bos=True )