File tree 4 files changed +6
-6
lines changed
examples/javascript/tasks 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const model = client.model("ainize/bart-base-cnn");
16
16
17
17
await model . load ( ) ;
18
18
19
- const { output : [ { summary_text } = { } ] = [ ] } = await model . run ( inputText , {
19
+ const { output : [ { summary_text } ] } = await model . run ( inputText , {
20
20
max_length : 40
21
21
} ) ;
22
22
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const model = client.model("google/flan-t5-base");
8
8
9
9
await model . load ( ) ;
10
10
11
- const { output : [ { generated_text } = { } ] = [ ] } = await model . run (
11
+ const { output : [ { generated_text } ] } = await model . run (
12
12
"Once upon a time there was a small little man who" ,
13
13
modelParams
14
14
) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ const model = client.model("Helsinki-NLP/opus-mt-en-zh");
8
8
9
9
await model . load ( ) ;
10
10
11
- const { output : [ { translation_text } = { } ] = [ ] } = await model . run ( inputText ) ;
11
+ const { output : [ { translation_text } ] } = await model . run ( inputText ) ;
12
12
13
13
console . log ( translation_text ) ;
Original file line number Diff line number Diff line change @@ -596,7 +596,7 @@ const model = client.model("ainize/bart-base-cnn");
596
596
597
597
await model .load ();
598
598
599
- const { output: [{ summary_text } = {}] = [ ] } = await model .run (inputText, {
599
+ const { output: [{ summary_text }] } = await model .run (inputText, {
600
600
max_length: 40
601
601
});
602
602
@@ -669,7 +669,7 @@ const model = client.model("Helsinki-NLP/opus-mt-en-zh");
669
669
670
670
await model .load ();
671
671
672
- const { output: [{ translation_text } = {}] = [] } = await model .run (inputText);
672
+ const { output: [{ translation_text }] } = await model .run (inputText);
673
673
674
674
console .log (translation_text);
675
675
` ` `
@@ -1045,7 +1045,7 @@ const model = client.model("google/flan-t5-base");
1045
1045
1046
1046
await model .load ();
1047
1047
1048
- const { output: [{ generated_text } = {}] = [ ] } = await model .run (
1048
+ const { output: [{ generated_text }] } = await model .run (
1049
1049
" Once upon a time there was a small little man who" ,
1050
1050
modelParams
1051
1051
);
You can’t perform that action at this time.
0 commit comments