From 75991d8795b5111fe2351997c5de88be6df380c7 Mon Sep 17 00:00:00 2001 From: Hamid Shojanazeri <hamid.nazeri2010@gmail.com> Date: Sun, 27 Aug 2023 19:03:18 +0000 Subject: [PATCH] fix the extra line added and remove take prompt from cli --- inference/code-llama/code_completion_example.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/inference/code-llama/code_completion_example.py b/inference/code-llama/code_completion_example.py index 106c54ad..348dadee 100644 --- a/inference/code-llama/code_completion_example.py +++ b/inference/code-llama/code_completion_example.py @@ -42,9 +42,7 @@ def main( prompt_file ), f"Provided Prompt file does not exist {prompt_file}" with open(prompt_file, "r") as f: - user_prompt = "\n".join(f.readlines()) - elif not sys.stdin.isatty(): - user_prompt = "\n".join(sys.stdin.readlines()) + user_prompt = f.read() else: print("No user prompt provided. Exiting.") sys.exit(1) -- GitLab