diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index ce05801..5a1f111 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -53,7 +53,7 @@ jobs: githubRepository: ${{ github.repository }} githubPullRequestNumber: ${{ github.event.pull_request.number }} gitCommitHash: ${{ github.event.pull_request.head.sha }} - repoId: "microsoft/codereviewer" + repoId: "meta-llama/Llama-2-7b-chat-hf" temperature: "0.2" maxNewTokens: "250" topK: "50" diff --git a/README.md b/README.md index 9c3989e..eadc4eb 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ jobs: githubRepository: ${{ github.repository }} githubPullRequestNumber: ${{ github.event.pull_request.number }} gitCommitHash: ${{ github.event.pull_request.head.sha }} - repoId: "microsoft/codereviewer" + repoId: "meta-llama/Llama-2-7b-chat-hf" temperature: "0.2" maxNewTokens: "250" topK: "50" diff --git a/action.yml b/action.yml index edf9c0b..d36b927 100644 --- a/action.yml +++ b/action.yml @@ -23,7 +23,7 @@ inputs: repoId: description: "LLM model" required: true - default: "microsoft/codereviewer" + default: "meta-llama/Llama-2-7b-chat-hf" maxNewTokens: description: "The amount of new tokens to be generated, this does not include the input length it is a estimate of the size of generated text you want. Each new tokens slows down the request, so look for balance between response times and length of text generated." required: false diff --git a/entrypoint.py b/entrypoint.py index ddd5131..c3658ca 100755 --- a/entrypoint.py +++ b/entrypoint.py @@ -86,13 +86,14 @@ def get_review( ) for chunked_diff in chunked_diff_list: question=chunked_diff - template = """Provide a concise summary of the bug found in the code, describing its characteristics, - location, and potential effects on the overall functionality and performance of the application. - Present the potential issues and errors first, following by the most important findings, in your summary - Important: Include block of code / diff in the summary also the line number. - ``` - {question} - ``` + template = """Provide a concise summary of the bug found in the code, describing its characteristics, + location, and potential effects on the overall functionality and performance of the application. + Present the potential issues and errors first, following by the most important findings, in your summary + Important: Include block of code / diff in the summary also the line number. + + Diff: + + {question} """ prompt = PromptTemplate(template=template, input_variables=["question"]) @@ -106,12 +107,12 @@ def get_review( question="\n".join(chunked_reviews) template = """Summarize the following file changed in a pull request submitted by a developer on GitHub, - focusing on major modifications, additions, deletions, and any significant updates within the files. - Do not include the file name in the summary and list the summary with bullet points. - Important: Include block of code / diff in the summary also the line number. - ``` - {question} - ``` + focusing on major modifications, additions, deletions, and any significant updates within the files. + Do not include the file name in the summary and list the summary with bullet points. + Important: Include block of code / diff in the summary also the line number. + + Diff: + {question} """ prompt = PromptTemplate(template=template, input_variables=["question"]) llm_chain = LLMChain(prompt=prompt, llm=llm)