I’ve used LFS to include some multimedia files in my Gradio app that I want to run on Spaces. Looks like the running container haven’t actually smudged the LFS tracked files, so my app fails because the multimedia files are still just cleartext LFS pointers.
How can I make my Gradio app access LFS committed files on the Spaces deployment?
INFO:__main__:Loading Country Girl - Wildflowers...
version https://git-lfs.github.com/spec/v1
oid sha256:acfb98e347f310bb1d2d9d68b646490a7e686235bf18af832cc0373409170ddc
size 2842130
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/gradio/queueing.py", line 541, in process_events
response = await route_utils.call_process_api(
File "/usr/local/lib/python3.10/site-packages/gradio/route_utils.py", line 276, in call_process_api
output = await app.get_blocks().process_api(
File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1928, in process_api
result = await self.call_function(
File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1514, in call_function
prediction = await anyio.to_thread.run_sync(
File "/usr/local/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
return await future
File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 859, in run
result = context.run(func, *args)
File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 833, in wrapper
response = f(*args, **kwargs)
File "/home/user/app/src/track_remixes/serve/app.py", line 250, in load_audio
info = sf.info(f"{base_path}.ogg")
File "/usr/local/lib/python3.10/site-packages/soundfile.py", line 436, in info
return _SoundFileInfo(file, verbose)
File "/usr/local/lib/python3.10/site-packages/soundfile.py", line 383, in __init__
with SoundFile(file) as f:
File "/usr/local/lib/python3.10/site-packages/soundfile.py", line 627, in __init__
self._file = self._open(file, mode_int, closefd)
File "/usr/local/lib/python3.10/site-packages/soundfile.py", line 1181, in _open
_error_check(_snd.sf_error(file_ptr),
File "/usr/local/lib/python3.10/site-packages/soundfile.py", line 1355, in _error_check
raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
RuntimeError: Error opening 'audio/Country Girl - Wildflowers/Country Girl.ogg': Format not recognised.