Help with Duplicating a SadTalker Space on Hugging Face
Subject: Help with Duplicating a SadTalker Space on Hugging FaceHey there,I’m working on a SadTalker project and using the basic CPU plan (2 vCPU, 16 GB RAM) on Hugging Face Spaces. I’ve run into a few issues when trying to clone or duplicate a space. The cloning process just doesn’t finish, and I can’t continue setting things up.I also tried cloning the space to my local machine, but that didn’t work out either. I’m hoping to create or duplicate a space that runs smoothly within the basic plan’s limits without causing any issues.Any advice or tips on how I can get this working would be awesome!Thanks a lot!
2024-08-28T06:08:33Z
I looked at it and it is due to Gradio having many incompatibilities between 3.x and 4.x.I removed the incompatibility parameter and fixed it to the point where it starts up for now.It’s kind of a rite of passage in HF to suffer Gradio version upgrades.But I wonder if this will work in CPU space in terms of performance…huggingface.coSadTalker - a Hugging Face Space by John6666Discover amazing ML apps made by the community
2024-08-29T02:18:20Z
i have cloned the original sadtalker repo from github into my local machine and then uploading it’s files and making a space out of it and i faced this issue:runtime errorExit code: 1. Reason: Traceback (most recent call last):File “/home/user/app/app.py”, line 3, infrom src.gradio_demo import SadTalkerFile “/home/user/app/src/gradio_demo.py”, line 5, infrom src.facerender.animate import AnimateFromCoeffFile “/home/user/app/src/facerender/animate.py”, line 23, infrom src.utils.face_enhancer import enhancer_generator_with_len, enhancer_listFile “/home/user/app/src/utils/face_enhancer.py”, line 4, infrom gfpgan import GFPGANerFile “/usr/local/lib/python3.10/site-packages/gfpgan/init.py”, line 2, infrom .archs import *File “/usr/local/lib/python3.10/site-packages/gfpgan/archs/init.py”, line 2, infrom basicsr.utils import scandirFile “/usr/local/lib/python3.10/site-packages/basicsr/init.py”, line 4, infrom .data import *File “/usr/local/lib/python3.10/site-packages/basicsr/data/init.py”, line 22, in_dataset_modules = [importlib.import_module(f’basicsr.data.{file_name}‘) for file_name in dataset_filenames]File “/usr/local/lib/python3.10/site-packages/basicsr/data/init.py”, line 22, in_dataset_modules = [importlib.import_module(f’basicsr.data.{file_name}’) for file_name in dataset_filenames]File “/usr/local/lib/python3.10/importlib/init.py”, line 126, in import_modulereturn _bootstrap._gcd_import(name[level:], package, level)File “/usr/local/lib/python3.10/site-packages/basicsr/data/realesrgan_dataset.py”, line 11, infrom basicsr.data.degradations import circular_lowpass_kernel, random_mixed_kernelsFile “/usr/local/lib/python3.10/site-packages/basicsr/data/degradations.py”, line 8, infrom torchvision.transforms.functional_tensor import rgb_to_grayscaleModuleNotFoundError: No module named ‘torchvision.transforms.functional_tensor’here is my space:huggingface.coSadTalker - a Hugging Face Space by HebatullahDiscover amazing ML apps made by the community
2024-08-29T04:14:50Z
Overall, the dependencies (requirement.txt) are broken. The author seems to assume Gradio version 3.x as well.This is partly unavoidable since Gradio is like a different language with versions 3.x and 4.x…I wonder if this is not code for running on HF’s space, but for local PCs, like StableDiffusion’s WebUI, for example?At least I was able to get it to boot up…huggingface.coSadTalker - a Hugging Face Space by John6666Discover amazing ML apps made by the community
2024-08-29T05:00:24Z
Thank you so much
2024-08-29T06:45:20Z
If it works, it’s OK.
2024-08-29T21:42:46Z
John6666/SadTalkerGitHub doesn’t work it gives me “Error” in the generated video section
2024-08-29T21:46:02Z
I want to ask another question, how can I make a notebook on Kaggle and Colab for Sad Talker and use Gradio’s Webui or link it to Ngrok? I can’t use Sad Talker on Colab and I tried so hard but I couldn’t reach a solution.
2024-08-29T23:02:22Z
FileNotFoundError: [Errno 2] No such file or directory: ‘checkpoints/auido2pose_00140-model.pth’It looks like I need to put this (maybe other files too) in the Spaces folder or download and relocate it myself in the program. (I can do that, but it’s a painP.S.I uploaded the previous space’s for now.).This is still for local PCs bacically.Sorry, I’ve never used Kaggle or Colab. I mean, I’m not familiar with cloud services in general, I’m just a guy who recently got back into programming and is in rehab._pickle.UnpicklingError: unpickling stack underflowSomething seems to be an old version of the model and I get a loading error, where is the new one?P.S.I  found the model. Now if we are going to get this to work, someone should first maintain it so that it is up-to-date.It seems to me that it would work with the new pytorch, especially if you fix the use of functions that are not in the current version of torchvision.Maintenance stopped in 2023…
2024-08-30T01:33:58Z
Can you run these 2 spaces on ZeroGPU?
2024-08-30T01:58:33Z
Sorry, but the slots are full, including space for private development and conversion. (That’s a limit of 10 per person…the organization has 30. Multiple accounts should be possible, but it’s a pain in the ass.)If you’re talking about processing to work on Zero GPU space, I can do that.Just putimport spaces at the top of app.pyandtop of each function’s .pyand pinpoint the@spaces.GPUdecorators to the functions you want to use GPU.P.S.I did.
2024-08-30T03:16:01Z
do you mean@spaces.GPU(duration=120)i didn’t find [add duration] section
2024-08-30T03:23:13Z
do you mean@spaces.GPU(duration=120)Actually,duration= and ()are optional.If I don’t specify it, it will be treated as 60 seconds.You can set them as needed. The longer it is, the longer it can be used for processing, but the longer the requested seconds, the more likely it is to becaught by quotas.I often set it to 30 seconds for light processing and 60 to 70 seconds for text-to-image inference.
2024-08-30T05:28:23Z
How to apply these changes?
2024-08-30T06:35:03Z
i committed the changes on your space and caused this issue, i think i made it wrong:runtime errorExit code: 1. Reason: File “/home/user/app/app.py”, line 112@spaces.GPUSyntaxError: invalid syntaxContainer logs:===== Application Startup at 2024-08-30 06:11:38 =====

  File "/home/user/app/app.py", line 112
    @spaces.GPU
SyntaxError: invalid syntax
  File "/home/user/app/app.py", line 112
    @spaces.GPU
SyntaxError: invalid syntax
2024-08-30T07:27:56Z
I fixed it. I also added “spaces” to the non-GitHub version.
2024-08-30T07:30:22Z
John6666:Just putimport spaces at the top of app.pyandtop of each function’s .pyand pinpoint the@spaces.GPUdecorators to the functions you want to use GPU.P.S.I did.where can i find this? and commit@spaces.GPUto the space:Just putimport spaces at the top of app.pyandtop of each function’s .pyand pinpoint the@spaces.GPUdecorators to the functions you want to use GPU.
2024-08-30T07:39:19Z
where can i find this?The only way to find and specify the function that is responsible for the most important part of the process, which is faster when using a GPU.If you read app.py from the top and follow all the imports and from’s, you will find it someday.An easier way is to find the function called in Gradio’s events.In SadTalker’ app.py, the clue is here.submit.click(
                        fn=sad_talker.test, 
                        inputs=[source_image,The function that is called when a button is pressed is usually the main body of the inference function.Because that’s how they are usually made.If you follow this, you will reachgradio_demo.pyin thesrcfolder, find thetestmethod from there, add a decorator, and you are done.(I did it this time).
2024-08-30T19:39:32Z
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.