소스 검색

fix the extra line added and remove take prompt from cli

Hamid Shojanazeri 1 년 전
부모
커밋
75991d8795
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      inference/code-llama/code_completion_example.py

+ 1 - 3
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)