-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into gw-list-model-filter-upgrade
- Loading branch information
Showing
105 changed files
with
4,346 additions
and
1,397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Comment PRs | ||
on: | ||
pull_request_target: | ||
|
||
jobs: | ||
comment-pr: | ||
env: | ||
MODEL_NAME: hermes-2-theta-llama-3-8b | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: "${{ github.event.pull_request.merge_commit_sha }}" | ||
fetch-depth: 0 # needed to checkout all branches for this Action to work | ||
- uses: mudler/localai-github-action@v1 | ||
with: | ||
model: 'hermes-2-theta-llama-3-8b' # Any from models.localai.io, or from huggingface.com with: "huggingface://<repository>/file" | ||
# Check the PR diff using the current branch and the base branch of the PR | ||
- uses: GrantBirki/[email protected] | ||
id: git-diff-action | ||
with: | ||
json_diff_file_output: diff.json | ||
raw_diff_file_output: diff.txt | ||
file_output_only: "true" | ||
base_branch: ${{ github.event.pull_request.base.sha }} | ||
- name: Show diff | ||
env: | ||
DIFF: ${{ steps.git-diff-action.outputs.raw-diff-path }} | ||
run: | | ||
cat $DIFF | ||
- name: Summarize | ||
env: | ||
DIFF: ${{ steps.git-diff-action.outputs.raw-diff-path }} | ||
id: summarize | ||
run: | | ||
input="$(cat $DIFF)" | ||
# Define the LocalAI API endpoint | ||
API_URL="http://localhost:8080/chat/completions" | ||
# Create a JSON payload using jq to handle special characters | ||
json_payload=$(jq -n --arg input "$input" '{ | ||
model: "'$MODEL_NAME'", | ||
messages: [ | ||
{ | ||
role: "system", | ||
content: "You are LocalAI-bot in Github that helps understanding PRs and assess complexity. Explain what has changed in this PR diff and why" | ||
}, | ||
{ | ||
role: "user", | ||
content: $input | ||
} | ||
] | ||
}') | ||
# Send the request to LocalAI | ||
response=$(curl -s -X POST $API_URL \ | ||
-H "Content-Type: application/json" \ | ||
-d "$json_payload") | ||
# Extract the summary from the response | ||
summary="$(echo $response | jq -r '.choices[0].message.content')" | ||
# Print the summary | ||
# -H "Authorization: Bearer $API_KEY" \ | ||
echo "Summary:" | ||
echo "$summary" | ||
echo "payload sent" | ||
echo "$json_payload" | ||
{ | ||
echo 'message<<EOF' | ||
echo "$summary" | ||
echo EOF | ||
} >> "$GITHUB_OUTPUT" | ||
docker logs --tail 10 local-ai | ||
- uses: mshick/add-pr-comment@v2 | ||
if: always() | ||
with: | ||
repo-token: ${{ secrets.UPDATE_BOT_TOKEN }} | ||
message: ${{ steps.summarize.outputs.message }} | ||
message-failure: | | ||
Uh oh! Could not analyze this PR, maybe it's too big? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,12 +14,10 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # needed to checkout all branches for this Action to work | ||
- name: Start LocalAI | ||
run: | | ||
echo "Starting LocalAI..." | ||
docker run -e -ti -d --name local-ai -p 8080:8080 localai/localai:master-ffmpeg-core run --debug $MODEL_NAME | ||
until [ "`docker inspect -f {{.State.Health.Status}} local-ai`" == "healthy" ]; do echo "Waiting for container to be ready"; docker logs --tail 10 local-ai; sleep 2; done | ||
# Check the PR diff using the current branch and the base branch of the PR | ||
- uses: mudler/localai-github-action@v1 | ||
with: | ||
model: 'hermes-2-theta-llama-3-8b' # Any from models.localai.io, or from huggingface.com with: "huggingface://<repository>/file" | ||
# Check the PR diff using the current branch and the base branch of the PR | ||
- uses: GrantBirki/[email protected] | ||
id: git-diff-action | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ on: | |
push: | ||
branches: | ||
- master | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
env: | ||
|
@@ -29,11 +31,10 @@ jobs: | |
with: | ||
go-version: '1.21.x' | ||
cache: false | ||
|
||
- name: Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install build-essential ffmpeg protobuf-compiler ccache gawk | ||
sudo apt-get install build-essential ffmpeg protobuf-compiler ccache upx-ucl gawk | ||
sudo apt-get install -qy binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libgmock-dev | ||
- name: Install CUDA Dependencies | ||
run: | | ||
|
@@ -149,7 +150,7 @@ jobs: | |
- name: Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y wget curl build-essential ffmpeg protobuf-compiler ccache gawk cmake libgmock-dev | ||
sudo apt-get install -y wget curl build-essential ffmpeg protobuf-compiler ccache upx-ucl gawk cmake libgmock-dev | ||
- name: Intel Dependencies | ||
run: | | ||
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null | ||
|
@@ -250,7 +251,7 @@ jobs: | |
- name: Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends libopencv-dev protobuf-compiler ccache | ||
sudo apt-get install -y --no-install-recommends libopencv-dev protobuf-compiler ccache upx-ucl | ||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@1958fcbe2ca8bd93af633f11e97d44e567e945af | ||
go install google.golang.org/protobuf/cmd/[email protected] | ||
- name: Build stablediffusion | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,17 @@ jobs: | |
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: 'stable' | ||
- name: Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install protobuf-compiler | ||
- run: | | ||
go install github.com/swaggo/swag/cmd/swag@latest | ||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@1958fcbe2ca8bd93af633f11e97d44e567e945af | ||
go install google.golang.org/protobuf/cmd/[email protected] | ||
- name: Bump swagger 🔧 | ||
run: | | ||
make swagger | ||
make protogen-go swagger | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.