43 lines
941 B
PHP
43 lines
941 B
PHP
<?php
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Service;
|
|
|
|
use App\Entity\ModelGenerationConfig;
|
|
use App\Repository\ModelGenerationConfigRepository;
|
|
|
|
final class ModelGenerationConfigProvider
|
|
{
|
|
public function __construct(
|
|
private ModelGenerationConfigRepository $repository
|
|
)
|
|
{
|
|
}
|
|
|
|
public function getActiveForModel(): ModelGenerationConfig
|
|
{
|
|
$config = $this->repository->findActiveForModel();
|
|
|
|
if ($config !== null) {
|
|
return $config;
|
|
}
|
|
|
|
// ------------------------------
|
|
// Safe Enterprise Default Fallback
|
|
// ------------------------------
|
|
return new ModelGenerationConfig(
|
|
modelName: 'mto-model',
|
|
version: 0,
|
|
stream: false,
|
|
temperature: 0.1,
|
|
topK: 20,
|
|
topP: 0.8,
|
|
repeatPenalty: 1.05,
|
|
numCtx: 4096,
|
|
active: false
|
|
);
|
|
}
|
|
}
|