Update app_parquet.py
Browse files- app_parquet.py +4 -2
    	
        app_parquet.py
    CHANGED
    
    | @@ -186,13 +186,15 @@ PARQUET_DATASET_DIR.mkdir(parents=True, exist_ok=True) | |
| 186 |  | 
| 187 | 
             
            scheduler = ParquetScheduler(repo_id="example-space-to-dataset-parquet")
         | 
| 188 |  | 
| 189 | 
            -
            client = Client("stabilityai/stable-diffusion")
         | 
|  | |
| 190 |  | 
| 191 |  | 
| 192 | 
             
            def generate(prompt: str) -> tuple[str, list[str]]:
         | 
| 193 | 
             
                """Generate images on 'submit' button."""
         | 
| 194 | 
             
                # Generate from https://huggingface.co/spaces/stabilityai/stable-diffusion
         | 
| 195 | 
            -
                out_dir = client.predict(prompt, "", 9, fn_index=1)
         | 
|  | |
| 196 | 
             
                with (Path(out_dir) / "captions.json").open() as f:
         | 
| 197 | 
             
                    paths = list(json.load(f).keys())
         | 
| 198 |  | 
|  | |
| 186 |  | 
| 187 | 
             
            scheduler = ParquetScheduler(repo_id="example-space-to-dataset-parquet")
         | 
| 188 |  | 
| 189 | 
            +
            # client = Client("stabilityai/stable-diffusion") # Space is paused
         | 
| 190 | 
            +
            client = Client("runwayml/stable-diffusion-v1-5")
         | 
| 191 |  | 
| 192 |  | 
| 193 | 
             
            def generate(prompt: str) -> tuple[str, list[str]]:
         | 
| 194 | 
             
                """Generate images on 'submit' button."""
         | 
| 195 | 
             
                # Generate from https://huggingface.co/spaces/stabilityai/stable-diffusion
         | 
| 196 | 
            +
                # out_dir = client.predict(prompt, "", 9, fn_index=1) # Space 'stabilityai/stable-diffusion' is paused
         | 
| 197 | 
            +
                out_dir = client.predict(prompt, fn_index=1)
         | 
| 198 | 
             
                with (Path(out_dir) / "captions.json").open() as f:
         | 
| 199 | 
             
                    paths = list(json.load(f).keys())
         | 
| 200 |  | 
