Skip to content

Commit

Permalink
add ljson
Browse files Browse the repository at this point in the history
  • Loading branch information
metelkin committed Jun 12, 2024
1 parent 57b0304 commit 149b673
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 11 additions & 3 deletions js/convert-to-heta.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ const summaryPath = path.resolve(BASE_DIR, '../sbml/summary');
const summary = require(summaryPath);


let html = ''
html += '<html><head><style></style></head><body><ul>'
let html = '';
html += '<html><head><style></style></head><body><h2>SBML Heta cases</h2><ul>'

let ljson = '';
summary.cases.forEach((item) => {
if (!item.l3v2RetCode) {
var hetaPath = path.resolve(BASE_DIR, '../sbml', item.id, 'l3v2/heta-code/output.heta');
Expand All @@ -28,8 +30,14 @@ summary.cases.forEach((item) => {

// update html page
html += `<li><a href="${item.id}/output.heta">${item.id}</a></li>`;

// update lson
let synop1 = synop.replace(/"/g, '\\"');
let heta1 = heta.replace(/"/g, '\\"');
ljson += `{"prompt": "${synop1}", "completion": "${heta1}"},\n`;
});

html += '</ul></body></html>';

fse.writeFileSync(path.resolve(BASE_DIR, 'index.html'), html);
fse.writeFileSync(path.resolve(BASE_DIR, 'index.html'), html);
fse.writeFileSync(path.resolve(BASE_DIR, 'heta-finetune-0.ljson'), ljson);
2 changes: 2 additions & 0 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<body>
<h1>Result of testing SBML cases</h1>
<p><i>Repository's home is <a href="https://github.com/insysbio/sbml-heta-cases">HERE</a></i></p>
<p><i>List of models in Heta format <a href="heta">HERE</a></i></p>
<p><i>LJSON is <a href="heta/heta-finetune-0.ljson">HERE</a></i></p>
<!-- BEGIN -->
<div>
<h2>From SBML L2V5/L3V2</h2>
Expand Down

0 comments on commit 149b673

Please sign in to comment.