Skip to content

Commit

Permalink
not executing
Browse files Browse the repository at this point in the history
  • Loading branch information
mike dupont committed Dec 9, 2023
1 parent 1193766 commit 34cf9d6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ add_library(ggml OBJECT
print.hpp
plugin_python.cpp
plugin_nodejs.cpp
plugin_nodejs_metacall.cpp
ggml-internal.hpp
llama-internal.hpp
ggml-alloc.cpp
Expand Down
12 changes: 8 additions & 4 deletions examples/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@

#include "print.hpp"
//#include "plugin_python.hpp"
#include "plugin_nodejs.hpp"
#define process_output_plugin process_output_plugin_node
//#include "plugin_nodejs.hpp"
#include "plugin_nodejs_metacall.hpp"
#define process_output_plugin process_output_plugin_metacall
#define process_output_plugin_destroy process_output_plugin_metacall_destroy
#define process_output_plugin_init process_output_plugin_metacall_init


static llama_context ** g_ctx;
static llama_model ** g_model;
Expand Down Expand Up @@ -138,7 +142,7 @@ int main(int argc, char ** argv) {
// save choice to use color for later
// (note for later: this is a slightly awkward choice)
console::init(params.simple_io, params.use_color);
process_output_plugin_node_init();
process_output_plugin_init();
atexit([]() { console::cleanup(); });

if (params.logits_all) {
Expand Down Expand Up @@ -911,6 +915,6 @@ int main(int argc, char ** argv) {
LOG_TEE("Log end\n");
#endif // LOG_DISABLE_LOGS

process_output_plugin_node_destroy();
process_output_plugin_destroy();
return 0;
}
20 changes: 20 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

'use strict';

function sum(a, b) {
return a + b;
}

function timeout(ms, cb) {
return new Promise(resolve => setTimeout(() => resolve(cb()), ms));
}

async function async_sum(a, b) {
return await timeout(2000, () => sum(a, b));
}

module.exports = {
sum,
async_sum,
};

0 comments on commit 34cf9d6

Please sign in to comment.