Skip to content

Commit fa7fe8b

Browse files
committed
Address bot comments and cleanup
1 parent 49af64f commit fa7fe8b

File tree

1 file changed

+6
-6
lines changed
  • extensions/llamacpp-extension/src

1 file changed

+6
-6
lines changed

extensions/llamacpp-extension/src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,6 @@ export default class llamacpp_extension extends AIEngine {
875875
})
876876

877877
// Store the session info for later use
878-
console.log(sInfo)
879878
this.activeSessions.set(sInfo.pid, sInfo)
880879
await this.waitForModelLoad(sInfo)
881880

@@ -970,17 +969,18 @@ export default class llamacpp_extension extends AIEngine {
970969
if (!trimmedLine || trimmedLine === 'data: [DONE]') {
971970
continue
972971
}
973-
console.log(trimmedLine)
974972

975973
if (trimmedLine.startsWith('data: ')) {
976974
jsonStr = trimmedLine.slice(6)
977975
} else if (trimmedLine.startsWith('error: ')) {
978-
jsonStr = trimmedLine.slice(7)
979-
const error = JSON.parse(jsonStr)
980-
throw new Error(error.message)
976+
jsonStr = trimmedLine.slice(7)
977+
const error = JSON.parse(jsonStr)
978+
throw new Error(error.message)
979+
} else {
980+
// it should not normally reach here
981+
throw new Error('Malformed chunk')
981982
}
982983
try {
983-
console.log(jsonStr)
984984
const data = JSON.parse(jsonStr)
985985
const chunk = data as chatCompletionChunk
986986
yield chunk

0 commit comments

Comments
 (0)