Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from diffusers.models import UNet2DModel
|
4 |
-
from huggingface_hub import
|
5 |
|
6 |
-
|
7 |
-
config_file_url = hf_hub_url(repo_id="porestar/oadg_channels_64", filename="model.pt", revision="main")
|
8 |
-
cached_download(config_file_url)
|
9 |
|
10 |
model = UNet2DModel(
|
11 |
sample_size=64,
|
@@ -27,7 +25,7 @@ model = UNet2DModel(
|
|
27 |
),
|
28 |
)
|
29 |
|
30 |
-
model.load_state_dict(torch.load(
|
31 |
|
32 |
|
33 |
def classify_image(inp):
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from diffusers.models import UNet2DModel
|
4 |
+
from huggingface_hub import hf_hub_download
|
5 |
|
6 |
+
path = hf_hub_download(repo_id="porestar/oadg_channels_64", filename="model.pt")
|
|
|
|
|
7 |
|
8 |
model = UNet2DModel(
|
9 |
sample_size=64,
|
|
|
25 |
),
|
26 |
)
|
27 |
|
28 |
+
model.load_state_dict(torch.load(path))
|
29 |
|
30 |
|
31 |
def classify_image(inp):
|