diff options
Diffstat (limited to '')
-rw-r--r-- | etc/tool/translate_readme.py | 14 | ||||
-rw-r--r-- | g4f/Provider/DeepInfra.py | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/etc/tool/translate_readme.py b/etc/tool/translate_readme.py index 43bfdcde..e0a9b1f1 100644 --- a/etc/tool/translate_readme.py +++ b/etc/tool/translate_readme.py @@ -18,12 +18,12 @@ Don't translate or change inline code examples. ```md """ keep_note = "Keep this: [!Note] as [!Note].\n" -blacklist = [ +blocklist = [ '## Šī¸ Copyright', '## đ Providers and Models', '## đ Related GPT4Free Projects' ] -whitelist = [ +allowlist = [ "### Other", "### Models" ] @@ -52,15 +52,15 @@ async def translate(text): return result async def translate_part(part, i): - blacklisted = False - for headline in blacklist: + blocklisted = False + for headline in blocklist: if headline in part: - blacklisted = True - if blacklisted: + blocklisted = True + if blocklisted: lines = part.split('\n') lines[0] = await translate(lines[0]) part = '\n'.join(lines) - for trans in whitelist: + for trans in allowlist: if trans in part: part = part.replace(trans, await translate(trans)) else: diff --git a/g4f/Provider/DeepInfra.py b/g4f/Provider/DeepInfra.py index 183f00ea..f44679ff 100644 --- a/g4f/Provider/DeepInfra.py +++ b/g4f/Provider/DeepInfra.py @@ -61,6 +61,8 @@ class DeepInfra(AsyncGeneratorProvider, ProviderModelMixin): 'model' : cls.get_model(model), 'messages': messages, 'temperature': kwargs.get("temperature", 0.7), + 'max_tokens': kwargs.get("max_tokens", 512), + 'stop': kwargs.get("stop", []), 'stream' : True } async with session.post('https://api.deepinfra.com/v1/openai/chat/completions', |