Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita0b3056

Browse files
committed
Tweak prompt-categorize
1 parent1c290df commita0b3056

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎prompt-categorize.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ async function generate() {
22

33
constprefix=""
44
constsession=awaitai.languageModel.create({
5-
temperature:0.1,
5+
temperature:0,
66
topK:3,
77
initialPrompts:[
88
{role:"system",content:"Given a product description, provide a category name "+
@@ -27,6 +27,8 @@ async function generate() {
2727
consttbody=document.getElementById('productTable').getElementsByTagName('tbody')[0];
2828
tbody.innerHTML='';
2929

30+
// Keep track of categories to avoid synonyms or very similar categories.
31+
// Pre-seed with some of the common ones
3032
letcategories=newSet(["Clothing","Food","Home","Health","Crafts","Toys","Pets","Electronics","Office Supplies",
3133
"Books","Tools","Beauty","Jewelry","Furniture","Appliances"]);
3234

@@ -85,7 +87,7 @@ document.getElementById('downloadCsv').addEventListener('click', function() {
8587

8688
document.addEventListener('DOMContentLoaded',asyncfunction(){
8789
constst=document.getElementById(("status"));
88-
if(!'ai'inwindow||!'languageModel'inai){
90+
if(!('ai'inwindow)||!('languageModel'inai)){
8991
st.textContent="Unavailable";
9092
return;
9193
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp