Skip to content

Commit

Permalink
Relaxed dependency reqs, fixed analyzer typescript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
beveradb committed Jan 26, 2025
1 parent 984cea5 commit d03771a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 24 deletions.
1 change: 0 additions & 1 deletion lyrics-analyzer/src/components/LyricsAnalyzer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ export default function LyricsAnalyzer({ data, onFileLoad, apiClient, isReadOnly
onWordClick={handleWordClick}
flashingType={flashingType}
corrected_segments={data.corrected_segments}
highlightInfo={highlightInfo}
currentSource={currentSource}
onSourceChange={setCurrentSource}
onDebugInfoUpdate={setAnchorMatchInfo}
Expand Down
12 changes: 4 additions & 8 deletions lyrics-analyzer/src/components/ReferenceView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useMemo, useRef } from 'react'
import { Paper, Typography, Box, Button, Tooltip } from '@mui/material'
import { AnchorMatchInfo, HighlightInfo, LyricsData, LyricsSegment } from '../types'
import { Paper, Typography, Box, Button } from '@mui/material'
import { AnchorMatchInfo, LyricsData, LyricsSegment } from '../types'
import { FlashType, ModalContent } from './LyricsAnalyzer'
import { COLORS } from './constants'
import { HighlightedWord } from './styles'
Expand All @@ -21,7 +21,6 @@ interface ReferenceViewProps {
flashingType: FlashType
corrected_segments: LyricsSegment[]
highlightedWordIndex?: number
highlightInfo: HighlightInfo | null
currentSource: 'genius' | 'spotify'
onSourceChange: (source: 'genius' | 'spotify') => void
onDebugInfoUpdate?: (info: AnchorMatchInfo[]) => void
Expand All @@ -39,15 +38,14 @@ export default function ReferenceView({
flashingType,
corrected_segments,
highlightedWordIndex,
highlightInfo,
currentSource,
onSourceChange,
onDebugInfoUpdate
}: ReferenceViewProps) {
// Create a ref to store debug info to avoid dependency cycles
const debugInfoRef = useRef<AnchorMatchInfo[]>([])

const { newlineInfo, newlineIndices } = useMemo(() => {
const { newlineIndices } = useMemo(() => {
debugInfoRef.current = corrected_segments.map(segment => ({
segment: segment.text.trim(),
lastWord: '',
Expand All @@ -57,7 +55,6 @@ export default function ReferenceView({
debugLog: []
}));

const newlineInfo = new Map<number, string>()
const newlineIndices = new Set(
corrected_segments.slice(0, -1).map((segment, segmentIndex) => {
const segmentText = segment.text.trim()
Expand Down Expand Up @@ -144,15 +141,14 @@ export default function ReferenceView({
}
}

newlineInfo.set(position, segment.text.trim())
return position
}
}

return null
}).filter((pos): pos is number => pos !== null && pos >= 0)
)
return { newlineInfo, newlineIndices }
return { newlineIndices }
}, [corrected_segments, anchors, currentSource])

// Update debug info whenever it changes
Expand Down
28 changes: 13 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "lyrics-transcriber"
version = "0.32.1"
version = "0.32.2"
description = "Automatically create synchronised lyrics files in ASS and MidiCo LRC formats with word-level timestamps, using Whisper and lyrics from Genius and Spotify"
authors = ["Andrew Beveridge <[email protected]>"]
license = "MIT"
Expand All @@ -20,17 +20,17 @@ karaoke-lyrics-processor = ">=0.4"
dropbox = ">=12"
python-dotenv = ">=1"
pydub = ">=0.25"
spacy = "^3.8.3"
tqdm = "^4.67.1"
python-levenshtein = "^0.26.1"
transformers = "^4.47.1"
torch = "^2.5.1"
metaphone = "^0.6"
nltk = "^3.9.1"
spacy-syllables = "^3.0.2"
syllables = "^1.0.9"
fastapi = "^0.115.6"
uvicorn = "^0.34.0"
spacy = ">=3.8"
tqdm = ">=4.67"
python-levenshtein = ">=0.26"
transformers = ">=4.47"
torch = ">=2"
metaphone = ">=0.6"
nltk = ">=3.9"
spacy-syllables = ">=3"
syllables = ">=1"
fastapi = ">=0.115"
uvicorn = ">=0.34"

[tool.poetry.group.dev.dependencies]
black = ">=23"
Expand All @@ -52,6 +52,4 @@ build-backend = "poetry.core.masonry.api"
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
filterwarnings = [
"ignore:'audioop' is deprecated:DeprecationWarning"
]
filterwarnings = ["ignore:'audioop' is deprecated:DeprecationWarning"]

0 comments on commit d03771a

Please sign in to comment.