Skip to content

Commit

Permalink
[no ci] minor edit
Browse files Browse the repository at this point in the history
  • Loading branch information
amaiya committed May 10, 2023
1 parent 75e17e3 commit 61bd40a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ktrain/text/qa/generative_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def query(
marginal_relevance: bool = True,
answer=None,
key_filter: Optional[bool] = None,
show_token_usage=False,
# get_callbacks: Callable[[str], AsyncCallbackHandler] = lambda x: [],
):
"""
Expand All @@ -169,6 +170,10 @@ def query(
answer=answer,
key_filter=key_filter,
)
if not show_token_usage:
result.formatted_answer = result.formatted_answer.split("Tokens Used")[
0
]
return result
except RuntimeError:
raise Exception(
Expand Down

0 comments on commit 61bd40a

Please sign in to comment.