Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support local llm model token usage and add escape for database password #353

Merged
merged 4 commits into from
Nov 21, 2024

Conversation

SuperEver
Copy link
Contributor

…ssword

@wzh1994 wzh1994 changed the title 1. Support local llm model token usage. 2. Add escape for database pa… 1. Support local llm model token usage. 2. Add escape for database password Nov 20, 2024
@wzh1994 wzh1994 changed the title 1. Support local llm model token usage. 2. Add escape for database password Support local llm model token usage and add escape for database password Nov 20, 2024
@@ -396,7 +425,11 @@ def forward(self, __input: Union[Tuple[Union[str, Dict], str], str, Dict] = pack
cache = ""
else:
raise requests.RequestException('\n'.join([c.decode('utf-8') for c in r.iter_content(None)]))
return self._formatter.format(self._extract_and_format(messages))
temp_output = self._extract_and_format(messages)
usage["completion_tokens"] = self._estimate_token_usage(temp_output)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这句话是不是也应该在if isinstance(self, TrainableModule):里面

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上面也是

@wzh1994 wzh1994 merged commit e311e8d into LazyAGI:main Nov 21, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants