Issues with SadTalker ZeroGPU Spaces + Inquiry About Community Grant
Hi Hugging Face Team,I hope you’re doing well!I’ve been using two Spaces that run on the ZerGPU tier, but unfortunately, neither of them seems to be working correctly. They don’t generate images as expected and it gives me errors for outputs. The Spaces are:abreza/SadTalkerHan-123/SadTalkerI’d really appreciate any help in getting them to function properly.Also, I applied for the Community Grant for ZeroGPU but haven’t received any response yet. I really need access to it for my studies and work, and having it for free would be a huge help. Could you kindly provide some guidance on how the approval process works or what I might be missing?Looking forward to your response!Thanks a lot for your time and support.Best regards,Hebatullah Hesham
2024-10-07T22:38:00Z
I’ll try to debug it myself later when I have some free time, but I think it probably worked when the author of the space created it.Recently, the specifications for the Zero GPU space changed drastically, and there are still some bugs that occurred at that time, so maybe that’s why it doesn’t work. There are many such spaces.If you could report that it doesn’t work in one of the Discussions below or in the New Discussion, I think that would help speed up the resolution.huggingface.cozero-gpu-explorers/README · DiscussionsWe’re on a journey to advance and democratize artificial intelligence through open source and open science.I think the following post about community grant may be helpful.Unable to select Free grant that was given🤗AutoTrainThis repoHugging Face – The AI community building the future.got a free community grant.  However, when I try to select it, I get the error: “Only Hugging Face team members can update the sleep time of a Space with a community grant.” Might this be the case because it was granted one year ago, and since then some internal hugging face timing settings changed? 
Thanks for any advice on this! 
Here is one screenshot for reference:[image]
2024-10-08T08:57:39Z
huggingface.coSadTalker - a Hugging Face Space by abrezaDiscover amazing ML apps made by the communityWell, I decided to debug it, and when I copied the space, it worked normally even though I did not do anything.I guess it was because I hadn’t restarted the space after the HF-wide Zero GPU space refurbishment in the summer.But there’s no way to reboot it from the outside… if there was, anyone could use it for mischief.@not-lain@victorThere are probably quite a few Zero GPU spaces throughout HF that are up and running but not actually working anymore.Any idea of a mechanism or personnel that could force a restart on a wide range of spaces from the HF side?
2024-10-10T20:50:32Z
Is this means I have recived the ZeroGPU Grant?ewfqpwk900×422 34.5 KB
2024-10-10T22:28:23Z
I’ve never applied for a community grant so I don’t know…But I’ve never seen the screen I’m on, so probably yes.Edit:Sorry. I heard it wasn’t right.huggingface.cozero-gpu-explorers/README · Request for Community Grant for ZeroGPUHi Hugging Face team,
2024-10-10T23:55:53Z
do you know how to get approved for this community grant?
2024-10-11T01:12:38Z
I don’t know anything about it at all.P.S.@not-lainWhat are community grants actually like now?huggingface.coUsing GPU SpacesWe’re on a journey to advance and democratize artificial intelligence through open source and open science.
2024-10-11T21:16:08Z
Hi@HebatullahI have cloned the space in my personal account, and without changing anything it worked perfectly,SadTalker - a Hugging Face Space by not-lainI will delete the space in a while (no idea when), feel free to use it in the meantime.No clue why their spaces stopped functioning, maybe some memory overflow or something, but if this would ever happen in my space feel free to open a discussion there and let me know and i’ll investigate the issue.As for SadTalker , the model is small enough to run locally, the only things you need to change to make it run on your local PC  are remove the following- import spaces
(...)
- @spaces.GPU
(...)you can keep the rest as is and it should work for you.For Zero GPU access, I am not an admin so I have no say in this, the access to the organization was given at the earlier days for people for beta access and for feedback and to support some people, but since the feature is now stable for development they have stopped accespting requests lately, your best bet is toapply to join the organization and waitapply for a gpu grant and waitaccess pro (9$/month) which comes with 10 zero gpu spaces IIRCFeel free to join the HF discord server and ping me or post your questions there if you have any, we have a pretty active community there.Best of luck with your studies and wishing you all the bestRegardsHafedh Hichri (Lain)
2024-10-11T22:12:24Z
Hebatullah1hDo I clone this space to my device and delete this section?import spaces(…)@spaces.GPU(…)In which file is this section located?
2024-10-11T22:16:49Z
Thanks for the explanation.apply to join the organization and waitHuh? I’ve never heard of this, but do we get Zero GPU space if we belong to org?apply for a gpu grant and waitIs that procedure the one that is in the manual?I’m sure I’ve got it somewhere…Not that it matters, but in HF, themanuals that are automatically generated from the code are up-to-date, butthe parts where the code is closed, such as server-side spec changes, GUI changes, and many other parts are lacking manuals. I enjoy the many hidden features, but they are inconvenient.HF DiscordJoin from here.Join the Hugging Face Discord!Community CallsHey@John6666@mmty!Feel free to trythis link, or alternatively, you can try searching hugging face within Discord. Let me know if it works![image]Code for ZeroGPU Space compatible CPU SpaceIt’s a little uncool, but if you removeimport spacesand instead write this code at the beginning of your code, you can go back and forth between Zero GPU space and CPU space without any changes. (if everything else is ok).import os
if os.environ.get("SPACES_ZERO_GPU") is not None:
    import spaces
else:
    class spaces:
        @staticmethod
        def GPU(func):
            def wrapper(*args, **kwargs):
                return func(*args, **kwargs)
            return wrapper

@spaces.GPU
def fake_gpu():
  pass
2024-10-11T22:17:45Z
In which file is this section located?Maybe in app.py.
2024-10-11T22:20:12Z
Hi@HebatullahDo I clone this space to my device and delete this section?yes, you can download the files in that space in your PC and delete those 2 lines.you will find them in a file called app.py, they are not near each other, so look for them and delete them.Once you have done that, you can run your app like any normal python file and it will tell you where you can access your local host, open that url in your browser and you’re all set.
2024-10-11T22:37:29Z
John6666:Huh? I’ve never heard of this, but do we get Zero GPU space if we belong to org?the organization is inzero-gpu-explorers (ZeroGPU Explorers)John6666:Is that procedure the one that is in the manual?In any of your spaces go to settings and you will find it on the left, see picture belowimage962×406 41.1 KBJohn6666:Code for ZeroGPU Space compatible CPU Spacedidn’t try the code in this section but it looks solid from a first look, thanks for sharing this, I will consider this method in the future
2024-10-11T22:44:54Z
the organization is inzero-gpu-explorers (ZeroGPU Explorers)Thank you. I had thought that there were a lot of people who belonged to this group, but it had some obvious advantages.This might be a quicker workaround than a community grant.see picture belowIt’s obvious at a glance.it looks solid from a first lookThe base of this code is the one in the crunch clause, and it has a proven track record of working, so I guess I’m okay with it. And it’s not like we’re doing anything difficult.
2024-10-11T22:49:59Z
What are the device specifications that Sad Talker can run on? Will these specifications run Sad Talker + how long will it take to make one 12 second video?
2024-10-11T23:05:52Z
I have cloned your space do you mean deleteing these excalty? Is this the section I supposed to delete exactly from from line 6 to line 35?:import spacesimport torchimport gradio as grfrom huggingface_hub import snapshot_downloadfrom examples.get_examples import get_examplesfrom src.facerender.pirender_animate import AnimateFromCoeff_PIRenderfrom src.utils.preprocess import CropAndExtractfrom src.test_audio2coeff import Audio2Coefffrom src.facerender.animate import AnimateFromCoefffrom src.generate_batch import get_datafrom src.generate_facerender_batch import get_facerender_datafrom src.utils.init_path import init_pathcheckpoint_path = ‘checkpoints’config_path = ‘src/config’device = “cuda” if torch.cuda.is_available() else “mps” if platform.system() == ‘Darwin’ else “cpu”os.environ[‘TORCH_HOME’] = checkpoint_pathsnapshot_download(repo_id=‘vinthony/SadTalker-V002rc’,local_dir=checkpoint_path, local_dir_use_symlinks=True)def mp3_to_wav(mp3_filename, wav_filename, frame_rate):AudioSegment.from_file(file=mp3_filename).set_frame_rate(frame_rate).export(wav_filename, format=“wav”)@spaces.GPU(duration=120)def generate_video(source_image, driven_audio, preprocess=‘crop’, still_mode=False, use_enhancer=False,batch_size=1, size=256, pose_style=0, facerender=‘facevid2vid’, exp_scale=1.0,use_ref_video=False, ref_video=None, ref_info=None, use_idle_mode=False,length_of_audio=0, use_blink=True, result_dir=‘./results/’):# Initialize models and pathssadtalker_paths = init_path(checkpoint_path, config_path, size, False, preprocess)audio_to_coeff = Audio2Coeff(sadtalker_paths, device)preprocess_model = CropAndExtract(sadtalker_paths, device)animate_from_coeff = AnimateFromCoeff(sadtalker_paths, device) if facerender == ‘facevid2vid’ and device != ‘mps’else AnimateFromCoeff_PIRender(sadtalker_paths, device)
2024-10-11T23:11:50Z
don’t delete from line to lineonly delete what I have mentioned above, do not delete what’s between them
2024-10-11T23:13:43Z
Ok how to start SadTalker? from the cloned files I didn’t find webui.bat
2024-10-11T23:20:32Z
It’s a python file, you can run it as any normal python file, with the exception that it will open a local host for you instead.you can open your terminal (CMD) andcdinto that folder then run the commandsORyou can go to the folder that has the app and click on top and writecmdas shown in the picture belowimage1222×557 40.6 KBfirst time only (to download the necessary dependencies)pip install -r reequirements.txtto run the app (everytime you want to start your app )python app.pynow open any browser and go tohttp://127.0.0.1:7860(if you ever forget the url it will be shown in your terminal when you start your app )
2024-10-11T23:26:51Z
(base) E:\SadTalker>python app.pyTraceback (most recent call last):File “E:\SadTalker\app.py”, line 6, inimport spacesModuleNotFoundError: No module named ‘spaces’(base) E:\SadTalker>
No date available
No reply text available