How to add or download files and folders in/from the space
how to add or download files and folders in/from the spacehi i have a certain python files and folders that i wants to add into the huggingface space project… does any one has any idea how to add or import them into the project space cause i don’t find any of the option to do so.And even please guide where & how to download or export the python files created here for the same.Involving github is not a option.Thank you
2022-10-01T20:04:13Z
Hi@nightfury!You want to put files in your space that you don’t want to check into the GitHub repo of your space?Maybe you can put them in a private model repo and then clone the private repo while the space is being built?
2022-10-01T20:05:08Z
You can use the hub client library to programmatically check out a private repository on the hub:huggingface.coHub client libraryWe’re on a journey to advance and democratize artificial intelligence through open source and open science.
2022-10-02T09:04:57Z
freddyaboulton:that you don’t want to check into the GitHub repo of your spaceYou mean git repo not GitHub repo no?
2022-10-03T07:56:26Z
actually I wants to import/upload a files&folders to my particular space & wants to refernce those & use in the app.But i can’t find any usefull interface here to import, export, selecting or deleting any files here.secondly… yes wants to clone or download particular folder to huggingface from available github repository… that i thing is not available.i can’t even find cmd line tool interface here too. so help me with that too.Thanks
2022-10-03T08:35:12Z
Like as in with web upload file option i uploaded a zip file now i wants to extract those files and folders in it but than that’s not possible as such interface not possible.next is doesn’t have a terminal option available to unzip.pardon me here im new to this… so this ltl queries gets arising.
2022-10-03T14:24:39Z
Hi@nightfury!You are correct that there is not currently a command line interface for the machine running your space.If you need to do some “setup” actions in your space, you can do that in theapp.pyfile prior to when you define and launch your gradio app.So something likeimport gradio as gr

download_and_extract_zip_file()
clone_github_repository()

with gr.Blocks() as demo:
    ...application code goes here ...


demo.launch()Thedownload_and_extract_zip_file()andclone_github_repository()code will only run once.So you’re basically limited to what you can do with python.Here are some resources I found that could help you get started:Unzipping a file in python:zip - Unzipping files in Python - Stack OverflowCloning a github repository with python:Python way to clone a git repository - Stack Overflow(You can also use thesubprocess moduleI believe)Downloading files from the huggingface hub with python:Quick start
2022-10-04T08:24:28Z
thanks… but this all creates#runtimeerrorSpace not ready. Reason: Completed, exitCode: 0, message: Nonei tried…1)import gitgit.Git(“./master”).clone(“GitHub - ThereforeGames/txt2mask: Automatically create masks for Stable Diffusion inpainting using natural language.”)from zipfile import ZipFileZipFile(“master.zip”).extractall(master)but this all creates a files and folders in runtime build enviornment ie. in ‘home/user/app/’ not in actual huggingface spaces project’s directory.
2022-10-04T08:28:13Z
I found this code…::import sysimport ospath = “./master”clone = “git clonehttps://github.com/<git_repository_path>.git”os.system(“sshpass -p your_password ssh user_name@your_localhost”)os.chdir(path) # Specifying the path where the cloned project needs to be copiedos.system(clone) # Cloningbut not sure about ‘your_localhost’ variable info as its managed from your end.
2022-10-04T08:50:27Z
I could see many projects  in here having multiple folders and files created and commited at once. may i know how are they doing so. what importing machanisms are they applying.Does this huggingface has repository in github if its so than how to access them. is it the same credentials created in here applies there too
2022-10-12T15:46:13Z
i used local git - gone through its working all over again and cloned, pulled, push, & committed with desired folders and file structures.i think huggingface needs to provide interface with out of the box gui interface and features.developer to developer kind.needs to getaway its dependency from git type structure and aPi if being used.
2022-10-12T15:48:11Z
hey i’m facing the issue for ‘cpu’ device… inapp.py · nightfury/SD-InPainting at mainas no gpu - ‘Cuda’ available.if i set torch_dtype=torch.float16,thn it throwsRuntimeError: expected scalar type Float but found BFloat16if i set torch_dtype=torch.bfloat16,thn it throwsRuntimeError: expected scalar type BFloat16 but found Float,if i set torch_dtype=torch.half,thn it throwsRuntimeError: “LayerNormKernelImpl” not implemented for ‘Half’if i set torch_dtype=torch.double,thn it throwsRuntimeError: expected scalar type BFloat16 but found Doubleif i set torch_dtype=torch.long,thn it throwsraise TypeError('nn.Module.to only accepts floating point or complex ’TypeError: nn.Module.to only accepts floating point or complex dtypes, but got desired dtype=torch.int64so i am really confused on what torch_dtype to use for successful run.
2023-12-01T18:34:56Z
Hello@nightfury,I have the same problem, that is I have no idea how to upload my folder/files to the HuggingFace Space. If you solved this problem, could you please help me?
2024-03-01T08:02:56Z
hey there i think you have to push to create a folder from the github. And for files they have provided an option now to upload one/multiple. some times it fails to upload multiple files of size more than 1mb so may have to try to upload one individually.