Skip to content

Commit

Permalink
remove debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
easychen committed Mar 4, 2023
1 parent 2e80d9d commit 2eeb805
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
12 changes: 4 additions & 8 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,12 @@ app.all(`*`, async (req, res) => {
'Authorization': 'Bearer '+ openai_key,
},
onMessage: (data) => {
console.log(data);
// console.log(data);
res.write("data: "+data+"\n\n" );
if( data === '[DONE]' )
{
res.write(data);
res.end();
}else
{
res.write("data: "+data+"\n\n" );
}

}
}
};

Expand Down Expand Up @@ -72,7 +68,7 @@ app.all(`*`, async (req, res) => {
if (!response.body.getReader) {
const body = response.body;
if (!body.on || !body.read) {
throw new ChatGPTError('unsupported "fetch" implementation');
throw new error('unsupported "fetch" implementation');
}
body.on("readable", () => {
let chunk;
Expand Down
12 changes: 4 additions & 8 deletions docker/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,12 @@ app.all(`*`, async (req, res) => {
'Authorization': 'Bearer '+ openai_key,
},
onMessage: (data) => {
console.log(data);
// console.log(data);
res.write("data: "+data+"\n\n" );
if( data === '[DONE]' )
{
res.write(data);
res.end();
}else
{
res.write("data: "+data+"\n\n" );
}

}
}
};

Expand Down Expand Up @@ -72,7 +68,7 @@ app.all(`*`, async (req, res) => {
if (!response.body.getReader) {
const body = response.body;
if (!body.on || !body.read) {
throw new ChatGPTError('unsupported "fetch" implementation');
throw new error('unsupported "fetch" implementation');
}
body.on("readable", () => {
let chunk;
Expand Down

0 comments on commit 2eeb805

Please sign in to comment.