style(tokenizer.js): comment out console.log statement

fix(Settings.jsx): handle null or empty context in useEffect to avoid errors
This commit is contained in:
Danny Avila 2023-04-04 10:07:48 -04:00
parent 1a196580b2
commit 6e233accf5
2 changed files with 3 additions and 5 deletions

View file

@ -7,7 +7,7 @@ const models = require('@dqbd/tiktoken/model_to_encoding.json');
router.post('/', async (req, res) => {
const { arg } = req.body;
console.log(typeof req.body === 'object' ? { ...req.body, ...req.query } : req.query);
// console.log(typeof req.body === 'object' ? { ...req.body, ...req.query } : req.query);
const model = await load(registry[models['gpt-3.5-turbo']]);
const encoder = new Tiktoken(model.bpe_ranks, model.special_tokens, model.pat_str);
const tokens = encoder.encode(arg.text);