mirror of
https://github.com/symfony/ai-transformers-php-platform.git
synced 2026-03-23 23:32:08 +01:00
39 lines
1.4 KiB
PHP
39 lines
1.4 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the Symfony package.
|
|
*
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Symfony\AI\Platform\Bridge\TransformersPhp\Tests;
|
|
|
|
use Symfony\AI\Platform\Bridge\TransformersPhp\ModelCatalog;
|
|
use Symfony\AI\Platform\Capability;
|
|
use Symfony\AI\Platform\Model;
|
|
use Symfony\AI\Platform\ModelCatalog\ModelCatalogInterface;
|
|
use Symfony\AI\Platform\Test\ModelCatalogTestCase;
|
|
|
|
/**
|
|
* @author Oskar Stark <oskarstark@googlemail.com>
|
|
*/
|
|
final class ModelCatalogTest extends ModelCatalogTestCase
|
|
{
|
|
public static function modelsProvider(): iterable
|
|
{
|
|
// TransformersPhp can use various models from HuggingFace, so we test with example model names
|
|
// Since it extends FallbackModelCatalog, all capabilities are provided
|
|
yield 'microsoft/DialoGPT-medium' => ['microsoft/DialoGPT-medium', Model::class, Capability::cases()];
|
|
yield 'sentence-transformers/all-MiniLM-L6-v2' => ['sentence-transformers/all-MiniLM-L6-v2', Model::class, Capability::cases()];
|
|
yield 'xenova/text-generation-webui' => ['xenova/text-generation-webui', Model::class, Capability::cases()];
|
|
}
|
|
|
|
protected function createModelCatalog(): ModelCatalogInterface
|
|
{
|
|
return new ModelCatalog();
|
|
}
|
|
}
|