Spaces:
Runtime error
Runtime error
Added application
Browse files
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
import os
|
3 |
+
|
4 |
+
import gradio as gr
|
5 |
+
|
6 |
+
from huggingface_hub import hf_hub_download
|
7 |
+
|
8 |
+
|
9 |
+
file_path = hf_hub_download("lfolle/DeepNAPSIModel", " dummy_model.pt",
|
10 |
+
use_auth_token=os.environ['TOKEN'])
|
11 |
+
model = torch.load(file_path)
|
12 |
+
|
13 |
+
def predict(data):
|
14 |
+
return model(data)
|
15 |
+
|
16 |
+
iface = gr.Interface(
|
17 |
+
predict,
|
18 |
+
title="DeepNAPSI Application",
|
19 |
+
inputs=gr.Image(),
|
20 |
+
outputs="numpy",
|
21 |
+
description=""
|
22 |
+
)
|
23 |
+
iface.launch()
|