File size: 886 Bytes
c9207fd
 
 
 
 
0675903
c9207fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import gradio as gr
from spaces_utils import authenticate


# Load tokens
GRADIO_TOKEN = os.environ.get("READ_TOKEN") # read


# Logs repo path
dataset_url = "https://huggingface.co/datasets/sandl/upload_bond_coat_segmentation"
dataset_path = "logs_bond_coat_segmentation.csv"


def authenticate_from_public(username, password):
    return authenticate(username, password, dataset_url, dataset_path)
    

css_styling = """#submit {background: #FF8C00} 
#submit {color: white} 
.output-image, .input-image, .image-preview {height: 250px !important}"""


with gr.Blocks(css=css_styling) as demo_from_private:
    gr.Interface.load("spaces/sandl/private_particles_segmentation", api_key=GRADIO_TOKEN, enable_queue=True)


if __name__ == "__main__":
    demo_from_private.queue(concurrency_count=2)
    demo_from_private.launch(auth=authenticate_from_public, debug=True, enable_queue=True)