Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,14 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import snapshot_download
|
| 3 |
import os
|
|
|
|
| 4 |
from diffusers import FluxPipeline
|
| 5 |
|
| 6 |
# 下载模型 (Space 启动时自动跑)
|
| 7 |
model_dir = "models/postercraft/postercraft_rl"
|
| 8 |
snapshot_download(repo_id="PosterCraft/PosterCraft-v1_RL", local_dir=model_dir, resume_download=True)
|
| 9 |
|
| 10 |
-
# 加载模型
|
| 11 |
pipe = FluxPipeline.from_pretrained(model_dir)
|
| 12 |
pipe.to("cuda" if torch.cuda.is_available() else "cpu")
|
| 13 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import snapshot_download
|
| 3 |
import os
|
| 4 |
+
import torch
|
| 5 |
from diffusers import FluxPipeline
|
| 6 |
|
| 7 |
# 下载模型 (Space 启动时自动跑)
|
| 8 |
model_dir = "models/postercraft/postercraft_rl"
|
| 9 |
snapshot_download(repo_id="PosterCraft/PosterCraft-v1_RL", local_dir=model_dir, resume_download=True)
|
| 10 |
|
| 11 |
+
# 加载模型
|
| 12 |
pipe = FluxPipeline.from_pretrained(model_dir)
|
| 13 |
pipe.to("cuda" if torch.cuda.is_available() else "cpu")
|
| 14 |
|