Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Add new phrase
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikidepia committed Mar 8, 2023
1 parent 2682810 commit 9db1baf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/contentScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,15 @@ function imageDataToTensor(image, dims) {
const label = task
.replace('Please click each image containing', '')
.replace('Please click on all images containing', '')
.replace('Please click on all images of', '')
.trim()
.replace(/^a /gm, '')
.replace(/^an /gm, '')
.replaceAll(' ', '_');
.replace(/^(a|an)\s+/i, '')
.replace(/\s+/g, '_')
.toLowerCase();

chrome.runtime.sendMessage(label, async function (response) {
if (response.status !== 200) {
console.log('error getting model', response, label);
return retry();
}
const model = await fetch(response.model);
Expand Down

0 comments on commit 9db1baf

Please sign in to comment.