first update to external config values
This commit is contained in:
@@ -4,15 +4,16 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Service;
|
||||
|
||||
use App\Config\ModelGenerationDefaultsConfig;
|
||||
use App\Entity\ModelGenerationConfig;
|
||||
use App\Repository\ModelGenerationConfigRepository;
|
||||
|
||||
final readonly class ModelGenerationConfigProvider
|
||||
{
|
||||
public function __construct(
|
||||
private ModelGenerationConfigRepository $repository
|
||||
)
|
||||
{
|
||||
private ModelGenerationConfigRepository $repository,
|
||||
private ModelGenerationDefaultsConfig $defaults,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getActiveForModel(): ModelGenerationConfig
|
||||
@@ -23,19 +24,18 @@ final readonly class ModelGenerationConfigProvider
|
||||
return $config;
|
||||
}
|
||||
|
||||
// ------------------------------
|
||||
// Safe Enterprise Default Fallback
|
||||
// ------------------------------
|
||||
return new ModelGenerationConfig(
|
||||
modelName: 'mto-model',
|
||||
modelName: $this->defaults->getModelName(),
|
||||
version: 0,
|
||||
stream: false,
|
||||
temperature: 0.1,
|
||||
topK: 20,
|
||||
topP: 0.8,
|
||||
repeatPenalty: 1.05,
|
||||
numCtx: 4096,
|
||||
active: false
|
||||
stream: $this->defaults->isStream(),
|
||||
temperature: $this->defaults->getTemperature(),
|
||||
topK: $this->defaults->getTopK(),
|
||||
topP: $this->defaults->getTopP(),
|
||||
repeatPenalty: $this->defaults->getRepeatPenalty(),
|
||||
numCtx: $this->defaults->getNumCtx(),
|
||||
active: false,
|
||||
retrievalMaxChunks: $this->defaults->getRetrievalMaxChunks(),
|
||||
retrievalVectorTopK: $this->defaults->getRetrievalVectorTopK(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -45,4 +45,4 @@ final readonly class ModelGenerationConfigProvider
|
||||
|
||||
return max(512, $numCtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user