Closed jpzhangvincent closed 1 year ago
Hey @jpzhangvincent, in the following code get_fact_check
has a scope conflict. The name of import from test_util
and function name under serving
decorator are conflicting, hence the maximum recursion depth exceeded
# test_api.py
import os
from loguru import logger
from lcserve import serving
from test_util import get_fact_check
@serving
def get_fact_check(query: str, **kwargs) -> str:
#logger.info("Query:", query)
check_output = get_fact_check(query)
return check_output
Please retry after changing it to
# test_api.py
import os
from loguru import logger
from lcserve import serving
from test_util import get_fact_check as _get_fact_check
@serving
def get_fact_check(query: str, **kwargs) -> str:
#logger.info("Query:", query)
check_output = _get_fact_check(query)
return check_output
Ah got it! Thanks!
You can close the issue!
I'm using the
LLMSummarizationCheckerChain
and put it into a separate util function. When I use this pattern of code and runlc-serve deploy local test_api
, I got the error - ""Error: maximum recursion depth exceeded" when testing the endpoint with the example text - "Mammals can lay eggs, birds can lay eggs, therefore birds are mammals" in the Swagger doc.Note that if I put the logic of the
get_fact_check
function intotest_api.py
- ,somehow it's working, which is more confusing...
I'm wondering whether the langchain-serve has some internal scoping conflict with
LLMSummarizationCheckerChain
during the iteration.Error: