-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from LlmLaraHub/embeddings_different_systems
Embeddings different systems
- Loading branch information
Showing
14 changed files
with
184 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...base/migrations/2024_04_09_142357_add_alternative_embeddings_sizes_to_document_chunks.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::table('document_chunks', function (Blueprint $table) { | ||
$table->vector('embedding_1536', 1536)->nullable(); | ||
$table->vector('embedding_2048', 2048)->nullable(); | ||
$table->vector('embedding_3072', 3072)->nullable(); | ||
$table->vector('embedding_4096', 4096)->nullable(); | ||
$table->dropColumn('embedding'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('document_chunks', function (Blueprint $table) { | ||
// | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ onMounted(() => { | |
}); | ||
const reset = () => { | ||
router.reload(); | ||
//router.reload(); | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace Tests\Feature; | ||
|
||
use App\Models\DocumentChunk; | ||
use Tests\TestCase; | ||
|
||
class HelpersTest extends TestCase | ||
{ | ||
/** | ||
* A basic feature test example. | ||
*/ | ||
public function test_config_helper(): void | ||
{ | ||
|
||
$this->assertEquals('mock', driverHelper('mock', 'models.embedding_model')); | ||
|
||
} | ||
|
||
public function test_get_embedding_size(): void | ||
{ | ||
|
||
$model = DocumentChunk::factory()->create(); | ||
|
||
$embedding_column = get_embedding_size($model->getEmbeddingDriver()); | ||
|
||
$this->assertEquals('embedding_4096', $embedding_column); | ||
|
||
$model = DocumentChunk::factory() | ||
->openAi() | ||
->create(); | ||
|
||
$embedding_column = get_embedding_size($model->getEmbeddingDriver()); | ||
|
||
$this->assertEquals('embedding_3072', $embedding_column); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1 @@ | ||
[ | ||
{ | ||
"name": "summarize_collection", | ||
"arguments": [ | ||
"TLDR it for me" | ||
] | ||
} | ||
] | ||
[] |