Spaces:
				
			
			
	
			
			
					
		Running
		
	
	
	
			
			
	
	
	
	
		
		
					
		Running
		
	Upload 117 files
Browse files- app.py +3 -8
- configs/opensora/inference/16x256x256.py +2 -2
- requirements.txt +1 -0
- setup.py +12 -12
    	
        app.py
    CHANGED
    
    | @@ -1,5 +1,5 @@ | |
| 1 | 
             
            import gradio as gr
         | 
| 2 | 
            -
            from huggingface_hub import hf_hub_download
         | 
| 3 | 
             
            import subprocess
         | 
| 4 | 
             
            import tempfile
         | 
| 5 | 
             
            import shutil
         | 
| @@ -9,18 +9,13 @@ import spaces | |
| 9 | 
             
            from transformers import T5ForConditionalGeneration, T5Tokenizer
         | 
| 10 | 
             
            import os
         | 
| 11 |  | 
| 12 | 
            -
             | 
| 13 |  | 
| 14 | 
             
            def download_t5_model(model_id, save_directory):
         | 
| 15 | 
             
                # Modelin tokenizer'ını ve modeli indir
         | 
| 16 | 
            -
                model = T5ForConditionalGeneration.from_pretrained(model_id)
         | 
| 17 | 
            -
                tokenizer = T5Tokenizer.from_pretrained(model_id)
         | 
| 18 | 
            -
             | 
| 19 | 
            -
                # Model ve tokenizer'ı belirtilen dizine kaydet
         | 
| 20 | 
             
                if not os.path.exists(save_directory):
         | 
| 21 | 
             
                    os.makedirs(save_directory)
         | 
| 22 | 
            -
                 | 
| 23 | 
            -
                tokenizer.save_pretrained(save_directory)
         | 
| 24 |  | 
| 25 | 
             
            # Model ID ve kaydedilecek dizin
         | 
| 26 | 
             
            model_id = "DeepFloyd/t5-v1_1-xxl"
         | 
|  | |
| 1 | 
             
            import gradio as gr
         | 
| 2 | 
            +
            from huggingface_hub import hf_hub_download, snapshot_download
         | 
| 3 | 
             
            import subprocess
         | 
| 4 | 
             
            import tempfile
         | 
| 5 | 
             
            import shutil
         | 
|  | |
| 9 | 
             
            from transformers import T5ForConditionalGeneration, T5Tokenizer
         | 
| 10 | 
             
            import os
         | 
| 11 |  | 
| 12 | 
            +
            print ("starting the app.")
         | 
| 13 |  | 
| 14 | 
             
            def download_t5_model(model_id, save_directory):
         | 
| 15 | 
             
                # Modelin tokenizer'ını ve modeli indir
         | 
|  | |
|  | |
|  | |
|  | |
| 16 | 
             
                if not os.path.exists(save_directory):
         | 
| 17 | 
             
                    os.makedirs(save_directory)
         | 
| 18 | 
            +
                snapshot_download(repo_id="DeepFloyd/t5-v1_1-xxl",local_dir=save_directory, local_dir_use_symlinks=False)
         | 
|  | |
| 19 |  | 
| 20 | 
             
            # Model ID ve kaydedilecek dizin
         | 
| 21 | 
             
            model_id = "DeepFloyd/t5-v1_1-xxl"
         | 
    	
        configs/opensora/inference/16x256x256.py
    CHANGED
    
    | @@ -7,8 +7,8 @@ model = dict( | |
| 7 | 
             
                type="STDiT-XL/2",
         | 
| 8 | 
             
                space_scale=0.5,
         | 
| 9 | 
             
                time_scale=1.0,
         | 
| 10 | 
            -
                enable_flashattn= | 
| 11 | 
            -
                enable_layernorm_kernel= | 
| 12 | 
             
                from_pretrained="PRETRAINED_MODEL",
         | 
| 13 | 
             
            )
         | 
| 14 | 
             
            vae = dict(
         | 
|  | |
| 7 | 
             
                type="STDiT-XL/2",
         | 
| 8 | 
             
                space_scale=0.5,
         | 
| 9 | 
             
                time_scale=1.0,
         | 
| 10 | 
            +
                enable_flashattn=False,
         | 
| 11 | 
            +
                enable_layernorm_kernel=False,
         | 
| 12 | 
             
                from_pretrained="PRETRAINED_MODEL",
         | 
| 13 | 
             
            )
         | 
| 14 | 
             
            vae = dict(
         | 
    	
        requirements.txt
    CHANGED
    
    | @@ -1,2 +1,3 @@ | |
| 1 | 
             
            xformers
         | 
| 2 | 
             
            git+https://github.com/hpcaitech/Open-Sora.git#egg=opensora
         | 
|  | 
|  | |
| 1 | 
             
            xformers
         | 
| 2 | 
             
            git+https://github.com/hpcaitech/Open-Sora.git#egg=opensora
         | 
| 3 | 
            +
            transformers
         | 
    	
        setup.py
    CHANGED
    
    | @@ -56,16 +56,16 @@ setup( | |
| 56 | 
             
                ],
         | 
| 57 | 
             
            )
         | 
| 58 |  | 
| 59 | 
            -
            install_options = [
         | 
| 60 | 
            -
             | 
| 61 | 
            -
             | 
| 62 | 
            -
             | 
| 63 | 
            -
             | 
| 64 | 
            -
             | 
| 65 | 
            -
            ]
         | 
| 66 |  | 
| 67 | 
            -
            subprocess.run(
         | 
| 68 | 
            -
             | 
| 69 | 
            -
             | 
| 70 | 
            -
             | 
| 71 | 
            -
            )
         | 
|  | |
| 56 | 
             
                ],
         | 
| 57 | 
             
            )
         | 
| 58 |  | 
| 59 | 
            +
            # install_options = [
         | 
| 60 | 
            +
            #     "--disable-pip-version-check",
         | 
| 61 | 
            +
            #     "--no-cache-dir",
         | 
| 62 | 
            +
            #     "--no-build-isolation",
         | 
| 63 | 
            +
            #     "--config-settings", "--build-option=--cpp_ext",
         | 
| 64 | 
            +
            #     "--config-settings", "--build-option=--cuda_ext"
         | 
| 65 | 
            +
            # ]
         | 
| 66 |  | 
| 67 | 
            +
            # subprocess.run(
         | 
| 68 | 
            +
            #     ["pip", "install", "-v"] + install_options + ["git+https://github.com/sandeshrajbhandari/apex.git#egg=apex"],
         | 
| 69 | 
            +
            #     check=True,
         | 
| 70 | 
            +
            #     capture_output=True
         | 
| 71 | 
            +
            # )
         | 
