mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 00:33:03 +08:00
add error traceback info (#3419)
Some checks failed
Deploy GitHub Pages / deploy (push) Has been cancelled
Some checks failed
Deploy GitHub Pages / deploy (push) Has been cancelled
* add error traceback info * update error msg * update code --------- Co-authored-by: Jiang-Jia-Jun <163579578+Jiang-Jia-Jun@users.noreply.github.com>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
"""
|
||||
|
||||
import os
|
||||
import traceback
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
from fastdeploy.config import ErnieArchitectures, FDConfig
|
||||
@@ -300,7 +301,7 @@ class BackendBase:
|
||||
|
||||
return tokenizer
|
||||
except Exception as e:
|
||||
raise Exception(f"Fail to initialize hf tokenizer: {e}")
|
||||
raise Exception(f"Fail to initialize hf tokenizer: {e}, {str(traceback.format_exc())}")
|
||||
|
||||
def add_cache(self, schemata_key: tuple[str, str], processor: LogitsProcessorBase) -> None:
|
||||
"""
|
||||
|
@@ -16,6 +16,7 @@
|
||||
|
||||
import json
|
||||
import re
|
||||
import traceback
|
||||
from typing import Any, List, Optional
|
||||
|
||||
import paddle
|
||||
@@ -263,7 +264,7 @@ class XGrammarBackend(BackendBase):
|
||||
try:
|
||||
compiled_grammar = self.grammar_compiler.compile_json_schema(schemata, any_whitespace=self.any_whitespace)
|
||||
except Exception as e:
|
||||
llm_logger.error(f"Failed to compile json schema: {e}")
|
||||
llm_logger.error(f"Failed to compile json schema: {e}, {str(traceback.format_exc())}")
|
||||
return None
|
||||
return self._create_processor(compiled_grammar)
|
||||
|
||||
@@ -280,7 +281,7 @@ class XGrammarBackend(BackendBase):
|
||||
try:
|
||||
compiled_grammar = self.grammar_compiler.compile_regex(schemata)
|
||||
except Exception as e:
|
||||
llm_logger.error(f"Failed to compile regex schema: {e}")
|
||||
llm_logger.error(f"Failed to compile regex schema: {e}, {str(traceback.format_exc())}")
|
||||
return None
|
||||
return self._create_processor(compiled_grammar)
|
||||
|
||||
@@ -297,7 +298,7 @@ class XGrammarBackend(BackendBase):
|
||||
try:
|
||||
compiled_grammar = self.grammar_compiler.compile_grammar(schemata)
|
||||
except Exception as e:
|
||||
llm_logger.error(f"Failed to compile ebnf schema: {e}")
|
||||
llm_logger.error(f"Failed to compile ebnf schema: {e}, {str(traceback.format_exc())}")
|
||||
return None
|
||||
return self._create_processor(compiled_grammar)
|
||||
|
||||
@@ -324,7 +325,7 @@ class XGrammarBackend(BackendBase):
|
||||
|
||||
compiled_grammar = self.grammar_compiler.compile_structural_tag(tags, structural_tag["triggers"])
|
||||
except Exception as e:
|
||||
llm_logger.error(f"Failed to compile structural tags schema: {e}")
|
||||
llm_logger.error(f"Failed to compile structural tags schema: {e}, {str(traceback.format_exc())}")
|
||||
return None
|
||||
return self._create_processor(compiled_grammar)
|
||||
|
||||
|
Reference in New Issue
Block a user