From 0d4f637760dc778e52a2c495a676ae0dcf75ebe6 Mon Sep 17 00:00:00 2001 From: nullstreak <139914347+nullstreak@users.noreply.github.com> Date: Sat, 24 Feb 2024 19:36:42 +0100 Subject: DeepInfra: Add max_tokens and stop --- g4f/Provider/DeepInfra.py | 2 ++ 1 file changed, 2 insertions(+) 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', -- cgit v1.2.3