Added temperature argument
This commit is contained in:
@@ -48,7 +48,8 @@ class Main:
|
|||||||
case "hf":
|
case "hf":
|
||||||
self._llm = HfLlmEngine(
|
self._llm = HfLlmEngine(
|
||||||
model_id=self._config.model,
|
model_id=self._config.model,
|
||||||
api_token=self._config.api_token
|
api_token=self._config.api_token,
|
||||||
|
temperature=self._config.temperature
|
||||||
)
|
)
|
||||||
case "test":
|
case "test":
|
||||||
self._llm = TestLLM()
|
self._llm = TestLLM()
|
||||||
|
|||||||
@@ -75,6 +75,12 @@ class Config:
|
|||||||
default=os.getenv('SIA_MODEL', '/root/model/'),
|
default=os.getenv('SIA_MODEL', '/root/model/'),
|
||||||
help='Path to the model directory (default: /root/model/, env: SIA_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()
|
self.args = parser.parse_args()
|
||||||
|
|
||||||
def _parse_bool_env(self, env_var: str, default: bool) -> bool:
|
def _parse_bool_env(self, env_var: str, default: bool) -> bool:
|
||||||
@@ -134,4 +140,9 @@ class Config:
|
|||||||
@property
|
@property
|
||||||
def model(self) -> str:
|
def model(self) -> str:
|
||||||
"""Path to the model directory."""
|
"""Path to the model directory."""
|
||||||
return self.args.model
|
return self.args.model
|
||||||
|
|
||||||
|
@property
|
||||||
|
def temperature(self) -> float:
|
||||||
|
"""LLM temperature parameter."""
|
||||||
|
return self.args.temperature
|
||||||
Reference in New Issue
Block a user