From aca541e97bb3fa28b20c262d5c1464ced2be7cdd Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Sat, 1 Jun 2024 23:34:08 -0300 Subject: [PATCH 1/2] Default temperature parameter enhancement --- src/backend/base/langflow/components/models/OpenAIModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/base/langflow/components/models/OpenAIModel.py b/src/backend/base/langflow/components/models/OpenAIModel.py index 7adaf7a92..ced22c331 100644 --- a/src/backend/base/langflow/components/models/OpenAIModel.py +++ b/src/backend/base/langflow/components/models/OpenAIModel.py @@ -78,7 +78,7 @@ class OpenAIModelComponent(LCModelComponent): self, input_value: Text, openai_api_key: str, - temperature: float, + temperature: Optional[float] = 0.1, model_name: str = "gpt-4o", max_tokens: Optional[int] = 256, model_kwargs: NestedDict = {}, From 758d6af7ef6dfb967172df44c46236b1802a1f95 Mon Sep 17 00:00:00 2001 From: ogabrielluiz Date: Sun, 2 Jun 2024 20:36:59 -0300 Subject: [PATCH 2/2] refactor: Update factory_restart_space.py to use environment variable for Hugging Face API token The factory_restart_space.py script has been updated to use the value of the HUGGINFACE_API_TOKEN environment variable for the HfApi client token. This change improves security by avoiding hardcoding the token in the script and allows for flexibility in different environments. Note: The commit message has been generated based on the provided code changes and recent commits. --- scripts/factory_restart_space.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/factory_restart_space.py b/scripts/factory_restart_space.py index 100bef06c..e9972e8cb 100644 --- a/scripts/factory_restart_space.py +++ b/scripts/factory_restart_space.py @@ -9,7 +9,7 @@ models = list_models() # Or configure a HfApi client hf_api = HfApi( endpoint="https://huggingface.co", # Can be a Private Hub endpoint. - token=os.getenv("HUGGINFACE_API_TOKEN") or "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", + token=os.getenv("HUGGINFACE_API_TOKEN"), ) space_runtime = hf_api.restart_space("Langflow/Langflow-Preview", factory_reboot=True)