Error occured: list index out of range

#3
by xi0v - opened

Hello! I encounter this error when I try to duplicate spaces

Error occured: No space_sdk provided. `create_repo` expects space_sdk to be one of ['gradio', 'streamlit', 'docker', 'static'] when repo_type is 'space'`"

The mysterious specifications of HfApi. I think I fixed it.

Thanks!

xi0v changed discussion status to closed
xi0v changed discussion title from Error occured: No space_sdk provided. `create_repo` expects space_sdk to be one of ['gradio', 'streamlit', 'docker', 'static'] when repo_type is 'space'`" to Error occured: list index out of range
xi0v changed discussion status to open

Error occured: list index out of range

I understand the meaning of the error message, but I'm still not sure what happened. Is it possible that findall doesn't return an empty list or tuple...? Is it an exception?

Traceback (most recent call last):
  File "/home/user/app/app.py", line 54, in duplicate
    dst_repo, subfolder = re.findall(r'^([\w_\-\.]+/[\w_\-\.]+)/?(.+)?$', dst_repo)[0]
IndexError: list index out of range

Edit:
I'm not sure how to fix it. This is after the branch, and a repo ID with an error here should eventually crash. Maybe I should make the error explicit.πŸ€”

I understand the meaning of the error message, but I'm still not sure what happened. Is it possible that findall doesn't return an empty list or tuple...? Is it an exception?

I myself don't understand where the error is coming from, should probably add more logging/debugging code so we can pinpoint the error

I'm not sure how to fix it. This is after the branch, and a repo ID with an error here should eventually crash. Maybe I should make the error explicit.πŸ€”

Yeah probably. I'll also try to look into it.

pinpoint the error

I've tidied up the code a bit.

pinpoint the error

I've tidied up the code a bit.

Now it's returned to the first error πŸ˜…

"Error occured: No space_sdk provided. `create_repo` expects space_sdk to be one of ['gradio', 'streamlit', 'docker', 'static'] when repo_type is 'space'`"

lol. Fixed. maybe.πŸ˜…

Edit:
BTW, from an HF perspective, it seems best to avoid uploading large files to Spaces.
https://github.com/huggingface/huggingface_hub/issues/2693#issuecomment-2520380926

Sign up or log in to comment