mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-08-26 07:29:40 +00:00
fix: update workflow to use HuggingFace Falcon model for PR description generation
This commit is contained in:
11
.github/workflows/pr-description.yml
vendored
11
.github/workflows/pr-description.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: 🤖 AI PR Description with HuggingFace
|
name: 🤖 AI PR Description with HuggingFace Falcon
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
@ -27,22 +27,23 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
|
GH_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
|
||||||
|
|
||||||
- name: Generate PR Description with HuggingFace (DeepSeek)
|
- name: Generate PR Description with HuggingFace Falcon
|
||||||
run: |
|
run: |
|
||||||
REQUEST_BODY=$(jq -n \
|
REQUEST_BODY=$(jq -n \
|
||||||
--arg inputs "Given the following commit messages:\n\n${commits}\n\nGenerate a clear and professional pull request description." \
|
--arg inputs "Given the following commit messages:\n\n${commits}\n\nGenerate a clear and professional pull request description." \
|
||||||
'{ inputs: $inputs }'
|
'{ inputs: $inputs }'
|
||||||
)
|
)
|
||||||
|
|
||||||
RESPONSE=$(curl -s https://api-inference.huggingface.co/models/deepseek-ai/deepseek-coder-6.7b-instruct \
|
RESPONSE=$(curl -s https://api-inference.huggingface.co/models/tiiuae/falcon-7b-instruct \
|
||||||
-H "Authorization: Bearer $HUGGINGFACE_API_KEY" \
|
-H "Authorization: Bearer $HUGGINGFACE_API_KEY" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "$REQUEST_BODY")
|
-d "$REQUEST_BODY")
|
||||||
|
|
||||||
DESCRIPTION=$(echo "$RESPONSE" | jq -r '.[0].generated_text')
|
|
||||||
|
|
||||||
echo "---------- HuggingFace Raw Response ----------"
|
echo "---------- HuggingFace Raw Response ----------"
|
||||||
echo "$RESPONSE"
|
echo "$RESPONSE"
|
||||||
|
|
||||||
|
DESCRIPTION=$(echo "$RESPONSE" | jq -r 'if type=="array" then .[0].generated_text else .error else "Error: Unexpected response" end')
|
||||||
|
|
||||||
echo "---------- Extracted Description ----------"
|
echo "---------- Extracted Description ----------"
|
||||||
echo "$DESCRIPTION"
|
echo "$DESCRIPTION"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user