8000 Reduce dimensionality of embeddings · coder/labeler@d7d8ec1 · GitHub
[go: up one dir, main page]

Skip to content

Commit d7d8ec1

Browse files
committed
Reduce dimensionality of embeddings
1 parent 55fc139 commit d7d8ec1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

indexer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (s *Indexer) findRandInstall(ctx context.Context) (*github.Installation, er
4646
return toIndex, nil
4747
}
4848

49-
const embeddingDimensions = 1536
49+
const embeddingDimensions = 256
5050

5151
func f32to64(f []float32) []float64 {
5252
out := make([]float64, len(f))
@@ -95,9 +95,9 @@ func (s *Indexer) issuesTable() *bigquery.Table {
9595
return s.BigQuery.Dataset("ghindex").Table("issues")
9696
}
9797

98-
// getCachedIssues helps avoid duplicate inserts by letting the caller skip over
98+
// getUpdatedAts helps avoid duplicate inserts by letting the caller skip over
9999
// issues that have already been indexed.
100-
func (s *Indexer) getCachedIssues(ctx context.Context, installID int64) (map[int64]time.Time, error) {
100+
func (s *Indexer) getUpdatedAts(ctx context.Context, installID int64) (map[int64]time.Time, error) {
101101
queryStr := `
102102
WITH RankedIssues AS (
103103
SELECT
@@ -186,7 +186,7 @@ func (s *Indexer) indexInstall(ctx context.Context, install *github.Installation
186186
table := s.issuesTable()
187187
inserter := table.Inserter()
188188

189-
cachedIssues, err := s.getCachedIssues(ctx, install.GetID())
189+
cachedIssues, err := s.getUpdatedAts(ctx, install.GetID())
190190
if err != nil {
191191
return fmt.Errorf("get cached issues: %w", err)
192192
}

0 commit comments

Comments
 (0)
0