Spaces:
Runtime error
Runtime error
harsh-manvar
commited on
Commit
·
f428037
1
Parent(s):
698b304
Update app.py
Browse files
app.py
CHANGED
@@ -47,7 +47,7 @@ def generate(
|
|
47 |
top_p: float,
|
48 |
top_k: int,
|
49 |
) -> Iterator[list[tuple[str, str]]]:
|
50 |
-
logger.info("message=%s",message)
|
51 |
if max_new_tokens > MAX_MAX_NEW_TOKENS:
|
52 |
raise ValueError
|
53 |
|
@@ -70,14 +70,14 @@ def process_example(message: str) -> tuple[str, list[tuple[str, str]]]:
|
|
70 |
|
71 |
|
72 |
def check_input_token_length(message: str, chat_history: list[tuple[str, str]], system_prompt: str) -> None:
|
73 |
-
logger.info("check_input_token_length=%s",message)
|
74 |
input_token_length = get_input_token_length(message, chat_history, system_prompt)
|
75 |
-
logger.info("input_token_length",input_token_length)
|
76 |
-
logger.info("MAX_INPUT_TOKEN_LENGTH",MAX_INPUT_TOKEN_LENGTH)
|
77 |
if input_token_length > MAX_INPUT_TOKEN_LENGTH:
|
78 |
logger.info("Inside IF condition")
|
79 |
raise gr.Error(f'The accumulated input is too long ({input_token_length} > {MAX_INPUT_TOKEN_LENGTH}). Clear your chat history and try again.')
|
80 |
-
logger.info("End of check_input_token_length function")
|
81 |
|
82 |
|
83 |
with gr.Blocks(css='style.css') as demo:
|
|
|
47 |
top_p: float,
|
48 |
top_k: int,
|
49 |
) -> Iterator[list[tuple[str, str]]]:
|
50 |
+
#logger.info("message=%s",message)
|
51 |
if max_new_tokens > MAX_MAX_NEW_TOKENS:
|
52 |
raise ValueError
|
53 |
|
|
|
70 |
|
71 |
|
72 |
def check_input_token_length(message: str, chat_history: list[tuple[str, str]], system_prompt: str) -> None:
|
73 |
+
#logger.info("check_input_token_length=%s",message)
|
74 |
input_token_length = get_input_token_length(message, chat_history, system_prompt)
|
75 |
+
#logger.info("input_token_length",input_token_length)
|
76 |
+
#logger.info("MAX_INPUT_TOKEN_LENGTH",MAX_INPUT_TOKEN_LENGTH)
|
77 |
if input_token_length > MAX_INPUT_TOKEN_LENGTH:
|
78 |
logger.info("Inside IF condition")
|
79 |
raise gr.Error(f'The accumulated input is too long ({input_token_length} > {MAX_INPUT_TOKEN_LENGTH}). Clear your chat history and try again.')
|
80 |
+
#logger.info("End of check_input_token_length function")
|
81 |
|
82 |
|
83 |
with gr.Blocks(css='style.css') as demo:
|