Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 46 additions & 24 deletions .github/workflows/scripts/labeler.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,59 @@ You may obtain a copy of the License at
limitations under the License.
*/


/**
* Invoked from labeler.yaml file to add
* label 'Gemma' to the issue and PR for which have gemma keyword present.
* @param {!Object.<string,!Object>} github contains pre defined functions.
* context Information about the workflow run.
* context Information about the workflow run.
*/

module.exports = async ({ github, context }) => {
const issue_title = context.payload.issue ? context.payload.issue.title : context.payload.pull_request.title
const issue_description = context.payload.issue ? context.payload.issue.body : context.payload.pull_request.body
const issue_number = context.payload.issue ? context.payload.issue.number : context.payload.pull_request.number
// Determine if the event is an issue or a pull request.
const isIssue = !!context.payload.issue;

// Get the issue/PR title, description, and number from the payload.
// Use an empty string for the description if it's null to prevent runtime errors.
const issue_title = isIssue ? context.payload.issue.title : context.payload.pull_request.title;
const issue_description = (isIssue ? context.payload.issue.body : context.payload.pull_request.body) || '';
const issue_number = isIssue ? context.payload.issue.number : context.payload.pull_request.number;

// Define the keyword-to-label mapping.
const keyword_label = {
gemma:'Gemma'
}
const labelsToAdd = []
console.log(issue_title,issue_description,issue_number)
gemma: 'Gemma'
};

for(const [keyword, label] of Object.entries(keyword_label)){
if(issue_title.toLowerCase().indexOf(keyword) !=-1 || issue_description.toLowerCase().indexOf(keyword) !=-1 ){
console.log(`'${keyword}'keyword is present inside the title or description. Pushing label '${label}' to row.`)
labelsToAdd.push(label)
// Array to hold labels that need to be added.
const labelsToAdd = [];

console.log(`Processing event for issue/PR #${issue_number}: "${issue_title}"`);

// Loop through the keywords and check if they exist in the title or description.
for (const [keyword, label] of Object.entries(keyword_label)) {
// Use .includes() for a cleaner and more modern check.
if (issue_title.toLowerCase().includes(keyword) || issue_description.toLowerCase().includes(keyword)) {
console.log(`'${keyword}' keyword is present in the title or description. Pushing label '${label}' to the array.`);
labelsToAdd.push(label);
}
}

// Add labels if the labelsToAdd array is not empty.
if (labelsToAdd.length > 0) {
console.log(`Adding labels ${labelsToAdd} to issue/PR '#${issue_number}'.`);

try {
// Await the asynchronous API call to ensure it completes.
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number, // Use the correct issue_number variable
labels: labelsToAdd
});
console.log(`Successfully added labels.`);
} catch (error) {
console.error(`Failed to add labels: ${error.message}`);
}
} else {
console.log("No matching keywords found. No labels to add.");
}
}
if(labelsToAdd.length > 0){
console.log(`Adding labels ${labelsToAdd} to the issue '#${issue_number}'.`)
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: labelsToAdd
})
}
};
};
2 changes: 2 additions & 0 deletions keras/src/backend/openvino/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def diagonal(x, offset=0, axis1=0, axis2=1):
ov_opset.add(ov_opset.constant(int(axis2), dtype="i64"), rank_val),
rank_val,
)

arange = ov_opset.range(
ov_opset.constant(0, dtype="i64"),
rank_val,
Expand Down Expand Up @@ -778,6 +779,7 @@ def deg2rad(x):
def diag(x, k=0):
raise NotImplementedError("`diag` is not supported with openvino backend")


def diff(a, n=1, axis=-1):
if n == 0:
return OpenVINOKerasTensor(get_ov_output(a))
Expand Down
Loading