Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import json
|
|
| 3 |
import re
|
| 4 |
import requests
|
| 5 |
import gradio as gr
|
|
|
|
| 6 |
from huggingface_hub import HfApi, hf_hub_download, create_repo
|
| 7 |
from safetensors.torch import load_file
|
| 8 |
from diffusers import StableDiffusionXLPipeline
|
|
@@ -15,6 +16,7 @@ CIVITAI_TOKEN = os.environ.get("CIVITAI_TOKEN", None) # Civitai用トークン
|
|
| 15 |
|
| 16 |
api = HfApi()
|
| 17 |
|
|
|
|
| 18 |
def download_and_upload(model_id, repo_type, new_repo_name=None):
|
| 19 |
print(f"モデルID: {model_id}, リポジトリタイプ: {repo_type}")
|
| 20 |
if not model_id or not repo_type:
|
|
|
|
| 3 |
import re
|
| 4 |
import requests
|
| 5 |
import gradio as gr
|
| 6 |
+
import spaces
|
| 7 |
from huggingface_hub import HfApi, hf_hub_download, create_repo
|
| 8 |
from safetensors.torch import load_file
|
| 9 |
from diffusers import StableDiffusionXLPipeline
|
|
|
|
| 16 |
|
| 17 |
api = HfApi()
|
| 18 |
|
| 19 |
+
@spaces.GPU(duration=120)
|
| 20 |
def download_and_upload(model_id, repo_type, new_repo_name=None):
|
| 21 |
print(f"モデルID: {model_id}, リポジトリタイプ: {repo_type}")
|
| 22 |
if not model_id or not repo_type:
|