-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- and methods that support it - add token_size to settings - convert token_ids column from serialisable to array - all tests
- Loading branch information
1 parent
94f70e7
commit 177c88b
Showing
7 changed files
with
452 additions
and
283 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This will destroy any data in the token_ids column of the sentence_chunks table | ||
class ConvertTokenIdsToArray < ActiveRecord::Migration[6.0] | ||
def up | ||
remove_column(:sentence_chunks, :token_ids) | ||
add_column(:sentence_chunks, :token_ids, :integer, array: true) | ||
end | ||
|
||
def down | ||
remove_column(:sentence_chunks, :token_ids) | ||
add_column(:sentence_chunks, :token_ids, :text) | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
FactoryBot.define do | ||
factory :sentence_chunk, class: SentenceChunk do | ||
size { 2 } | ||
token_ids { [1, 2] } | ||
count { 1 } | ||
# text_sample_two_chars | ||
association :text_sample, factory: :text_sample_two_chars | ||
end | ||
end |
Oops, something went wrong.