GithubHelp home page GithubHelp logo

Comments (2)

wasertech avatar wasertech commented on June 11, 2024

--relative is set to False by default.

STT/bin/import_librivox.py

Lines 193 to 197 in a694187

parser.add_argument(
"--relative",
action="store_true",
help="whether to store relative paths in CSV",
)

So it is using the absolute path of the wav files in the csv.

STT/bin/import_librivox.py

Lines 126 to 144 in a694187

# Convert corresponding FLAC to a WAV
base = trans_filename.parent.joinpath(seqid)
flac_file = base.with_suffix(".flac")
wav_file = (
dest_dir.joinpath(*seqid.split("-"))
.joinpath(seqid)
.with_suffix(".wav")
)
wav_file.parent.mkdir(parents=True, exist_ok=True)
if wav_file.exists():
wav_filesizes.append(os.path.getsize(wav_file))
else:
conversions.append((flac_file, wav_file, sample_rate))
if relative_to:
wav_file = wav_file.relative_to(relative_to)
files.append(str(wav_file))

STT/bin/import_librivox.py

Lines 152 to 155 in a694187

return pandas.DataFrame(
data=zip(files, wav_filesizes, transcripts),
columns=["wav_filename", "wav_filesize", "transcript"],
)

The real issue is with this line.

files.append(str(wav_file))

Since dest_dir is a Path object,
def _convert_audio_and_split_sentences(
source_dir: Path, dest_dir: Path, sample_rate: int, relative_to: Optional[Path]
):

it should really be

files.append(wav_file.as_posix())

from stt.

wasertech avatar wasertech commented on June 11, 2024

it should really be
files.append(wav_file.as_posix())

@RobinE89 can you make the changes locally and test if it works?

I'm starting to think that I've just broke compatibility with windows without even solving anything because str(Path()) should work as expected on all platforms...

https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.as_posix

Anyways you should probably set --realtive to True in all cases.

from stt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.