Minor fixes
frdel committed
Nov 27, 2024 at 22:16 UTC
5e8d6b1c7d3ec965eac864b2bb72c85360bae8c2
2 files changed
+4
-1
python/helpers/tokens.py
+3
@@ -3,6 +3,9 @@ import tiktoken
3
APPROX_BUFFER = 1.1
4
5
def count_tokens(text: str, encoding_name="cl100k_base") -> int:
6
+ if not text:
7
+ return 0
8
+
9
# Get the encoding
10
encoding = tiktoken.get_encoding(encoding_name)
11
webui/index.html
+1
-1
@@ -396,7 +396,7 @@
396
<div id="settingsModal" x-data="settingsModalProxy">
397
<template x-teleport="body">
398
<div x-show="isOpen" class="modal-overlay" @click.self="handleCancel()"
399
- @keydown.escape.window="handleClose()" x-transition>
399
+ @keydown.escape.window="handleCancel()" x-transition>
400
<div class="modal-container">
401
<div class="modal-header">
402
<h2 x-text="settings.title"></h2>