diff --git a/sia/__main__.py b/sia/__main__.py index 8338bcc..b3bdc53 100644 --- a/sia/__main__.py +++ b/sia/__main__.py @@ -48,7 +48,8 @@ class Main: case "hf": self._llm = HfLlmEngine( model_id=self._config.model, - api_token=self._config.api_token + api_token=self._config.api_token, + temperature=self._config.temperature ) case "test": self._llm = TestLLM() diff --git a/sia/config.py b/sia/config.py index d911a7b..96f33a2 100644 --- a/sia/config.py +++ b/sia/config.py @@ -75,6 +75,12 @@ class Config: default=os.getenv('SIA_MODEL', '/root/model/'), help='Path to the model directory (default: /root/model/, env: SIA_MODEL)' ) + parser.add_argument( + '--temperature', + type=float, + default=float(os.getenv('SIA_TEMPERATURE', '0.7')), + help='LLM temperature parameter (default: 0.7, env: SIA_TEMPERATURE)' + ) self.args = parser.parse_args() def _parse_bool_env(self, env_var: str, default: bool) -> bool: @@ -134,4 +140,9 @@ class Config: @property def model(self) -> str: """Path to the model directory.""" - return self.args.model \ No newline at end of file + return self.args.model + + @property + def temperature(self) -> float: + """LLM temperature parameter.""" + return self.args.temperature \ No newline at end of file