File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
examples/javascript/tasks Expand file tree Collapse file tree 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");
1616
1717await model . load ( ) ;
1818
19- const { output : [ { summary_text } = { } ] = [ ] } = await model . run ( inputText , {
19+ const { output : [ { summary_text } ] } = await model . run ( inputText , {
2020 max_length : 40
2121} ) ;
2222
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const model = client.model("google/flan-t5-base");
88
99await model . load ( ) ;
1010
11- const { output : [ { generated_text } = { } ] = [ ] } = await model . run (
11+ const { output : [ { generated_text } ] } = await model . run (
1212 "Once upon a time there was a small little man who" ,
1313 modelParams
1414) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ const model = client.model("Helsinki-NLP/opus-mt-en-zh");
88
99await model . load ( ) ;
1010
11- const { output : [ { translation_text } = { } ] = [ ] } = await model . run ( inputText ) ;
11+ const { output : [ { translation_text } ] } = await model . run ( inputText ) ;
1212
1313console . 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");
596596
597597await model .load ();
598598
599- const { output: [{ summary_text } = {}] = [ ] } = await model .run (inputText, {
599+ const { output: [{ summary_text }] } = await model .run (inputText, {
600600 max_length: 40
601601});
602602
@@ -669,7 +669,7 @@ const model = client.model("Helsinki-NLP/opus-mt-en-zh");
669669
670670await model .load ();
671671
672- const { output: [{ translation_text } = {}] = [] } = await model .run (inputText);
672+ const { output: [{ translation_text }] } = await model .run (inputText);
673673
674674console .log (translation_text);
675675` ` `
@@ -1045,7 +1045,7 @@ const model = client.model("google/flan-t5-base");
10451045
10461046await model .load ();
10471047
1048- const { output: [{ generated_text } = {}] = [ ] } = await model .run (
1048+ const { output: [{ generated_text }] } = await model .run (
10491049 " Once upon a time there was a small little man who" ,
10501050 modelParams
10511051);
You can’t perform that action at this time.
0 commit comments