Skip to content

Commit 9d536ec

Browse files
Merge pull request BuilderIO#62 from guillermoscript/multiple-files
Add gpt-tokenizer package and implement size and token limits
2 parents 0c53280 + ed47ed4 commit 9d536ec

File tree

5 files changed

+1687
-1044
lines changed

5 files changed

+1687
-1044
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ type Config = {
8484
* ['png','jpg','jpeg','gif','svg','css','js','ico','woff','woff2','ttf','eot','otf','mp4','mp3','webm','ogg','wav','flac','aac','zip','tar','gz','rar','7z','exe','dmg','apk','csv','xls','xlsx','doc','docx','pdf','epub','iso','dmg','bin','ppt','pptx','odt','avi','mkv','xml','json','yml','yaml','rss','atom','swf','txt','dart','webp','bmp','tif','psd','ai','indd','eps','ps','zipx','srt','wasm','m4v','m4a','webp','weba','m4b','opus','ogv','ogm','oga','spx','ogx','flv','3gp','3g2','jxr','wdp','jng','hief','avif','apng','avifs','heif','heic','cur','ico','ani','jp2','jpm','jpx','mj2','wmv','wma','aac','tif','tiff','mpg','mpeg','mov','avi','wmv','flv','swf','mkv','m4v','m4p','m4b','m4r','m4a','mp3','wav','wma','ogg','oga','webm','3gp','3g2','flac','spx','amr','mid','midi','mka','dts','ac3','eac3','weba','m3u','m3u8','ts','wpl','pls','vob','ifo','bup','svcd','drc','dsm','dsv','dsa','dss','vivo','ivf','dvd','fli','flc','flic','flic','mng','asf','m2v','asx','ram','ra','rm','rpm','roq','smi','smil','wmf','wmz','wmd','wvx','wmx','movie','wri','ins','isp','acsm','djvu','fb2','xps','oxps','ps','eps','ai','prn','svg','dwg','dxf','ttf','fnt','fon','otf','cab']
8585
*/
8686
resourceExclusions?: string[];
87+
/** Optional maximum file size in megabytes to include in the output file */
88+
maxFileSize?: number;
89+
/** Optional maximum number tokens to include in the output file */
90+
maxTokens?: number;
8791
};
8892
```
8993

@@ -115,6 +119,7 @@ Use this option for UI access to your generated knowledge that you can easily sh
115119
4. Choose "Create a GPT"
116120
5. Choose "Configure"
117121
6. Under "Knowledge" choose "Upload a file" and upload the file you generated
122+
7. if you get an error about the file being too large, you can try to split it into multiple files and upload them separately using the option maxFileSize in the config.ts file or also use tokenization to reduce the size of the file with the option maxTokens in the config.ts file
118123

119124
![Gif of how to upload a custom GPT](https://github.com/BuilderIO/gpt-crawler/assets/844291/22f27fb5-6ca5-4748-9edd-6bcf00b408cf)
120125

0 commit comments

Comments
 (0)