Renamed hf-api-token to api-token

This commit is contained in:
2024-11-11 13:25:39 +01:00
parent 0d98a42df6
commit babc1c44b9
2 changed files with 7 additions and 7 deletions

View File

@@ -48,7 +48,7 @@ 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.hf_api_token api_token=self._config.api_token
) )
case "test": case "test":
self._llm = TestLLM() self._llm = TestLLM()

View File

@@ -64,10 +64,10 @@ class Config:
help='LLM engine (default: local, env: SIA_LLM_ENGINE)' help='LLM engine (default: local, env: SIA_LLM_ENGINE)'
) )
parser.add_argument( parser.add_argument(
'--hf-api-token', '--api-token',
type=str, type=str,
default=os.getenv('SIA_HF_API_TOKEN'), default=os.getenv('SIA_API_TOKEN'),
help='Hugging Face access token (env: SIA_HF_API_TOKEN)' help='API access token (env: SIA_API_TOKEN)'
) )
parser.add_argument( parser.add_argument(
'--model', '--model',
@@ -127,9 +127,9 @@ class Config:
return self.args.llm_engine return self.args.llm_engine
@property @property
def hf_api_token(self) -> Optional[str]: def api_token(self) -> Optional[str]:
"""Hugging Face access token.""" """API access token."""
return self.args.hf_api_token return self.args.api_token
@property @property
def model(self) -> str: def model(self) -> str: