File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change
1
+ // Tesseract relies on node-fetch v2, which has a deprecated version of punycode
2
+ // Suppress the warning for now. Check in when teseract updates to node-fetch v3
3
+ // https://github.com/naptha/tesseract.js/issues/876
4
+ if ( process . stderr . write === process . stderr . constructor . prototype . write ) {
5
+ const stdErrWrite = process . stderr . write ;
6
+ process . stderr . write = function ( chunk : any , ...args : any [ ] ) {
7
+ const str = Buffer . isBuffer ( chunk ) ? chunk . toString ( ) : chunk ;
8
+
9
+ // Filter out the punycode deprecation warning
10
+ if ( str . includes ( "punycode" ) ) {
11
+ return true ;
12
+ }
13
+ return stdErrWrite . apply ( process . stderr , [ chunk ] ) ;
14
+ } ;
15
+ }
Original file line number Diff line number Diff line change
1
+ import "./handleWarnings" ;
1
2
import {
2
3
addWorkersToTesseractScheduler ,
3
4
cleanupImage ,
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const convertAsync = promisify(convert);
16
16
17
17
const defaultLLMParams : LLMParams = {
18
18
frequencyPenalty : 0 , // OpenAI defaults to 0
19
- maxTokens : 2000 ,
19
+ maxTokens : 4000 ,
20
20
presencePenalty : 0 , // OpenAI defaults to 0
21
21
temperature : 0 ,
22
22
topP : 1 , // OpenAI defaults to 1
You can’t perform that action at this time.
0 commit comments