Update app.py
Browse files
app.py
CHANGED
|
@@ -42,80 +42,3 @@ iface = gr.Interface(
|
|
| 42 |
|
| 43 |
iface.launch()
|
| 44 |
|
| 45 |
-
css="""
|
| 46 |
-
#col-container {max-width: 780px; margin-left: auto; margin-right: auto;}
|
| 47 |
-
#upl-dataset-group {background-color: none!important;}
|
| 48 |
-
div#warning-ready {
|
| 49 |
-
background-color: #ecfdf5;
|
| 50 |
-
padding: 0 10px 5px;
|
| 51 |
-
margin: 20px 0;
|
| 52 |
-
}
|
| 53 |
-
div#warning-ready > .gr-prose > h2, div#warning-ready > .gr-prose > p {
|
| 54 |
-
color: #057857!important;
|
| 55 |
-
}
|
| 56 |
-
div#warning-duplicate {
|
| 57 |
-
background-color: #ebf5ff;
|
| 58 |
-
padding: 0 10px 5px;
|
| 59 |
-
margin: 20px 0;
|
| 60 |
-
}
|
| 61 |
-
div#warning-duplicate > .gr-prose > h2, div#warning-duplicate > .gr-prose > p {
|
| 62 |
-
color: #0f4592!important;
|
| 63 |
-
}
|
| 64 |
-
div#warning-duplicate strong {
|
| 65 |
-
color: #0f4592;
|
| 66 |
-
}
|
| 67 |
-
p.actions {
|
| 68 |
-
display: flex;
|
| 69 |
-
align-items: center;
|
| 70 |
-
margin: 20px 0;
|
| 71 |
-
}
|
| 72 |
-
div#warning-duplicate .actions a {
|
| 73 |
-
display: inline-block;
|
| 74 |
-
margin-right: 10px;
|
| 75 |
-
}
|
| 76 |
-
div#warning-setgpu {
|
| 77 |
-
background-color: #fff4eb;
|
| 78 |
-
padding: 0 10px 5px;
|
| 79 |
-
margin: 20px 0;
|
| 80 |
-
}
|
| 81 |
-
div#warning-setgpu > .gr-prose > h2, div#warning-setgpu > .gr-prose > p {
|
| 82 |
-
color: #92220f!important;
|
| 83 |
-
}
|
| 84 |
-
div#warning-setgpu a, div#warning-setgpu b {
|
| 85 |
-
color: #91230f;
|
| 86 |
-
}
|
| 87 |
-
div#warning-setgpu p.actions > a {
|
| 88 |
-
display: inline-block;
|
| 89 |
-
background: #1f1f23;
|
| 90 |
-
border-radius: 40px;
|
| 91 |
-
padding: 6px 24px;
|
| 92 |
-
color: antiquewhite;
|
| 93 |
-
text-decoration: none;
|
| 94 |
-
font-weight: 600;
|
| 95 |
-
font-size: 1.2em;
|
| 96 |
-
}
|
| 97 |
-
button#load-dataset-btn{
|
| 98 |
-
min-height: 60px;
|
| 99 |
-
}
|
| 100 |
-
"""
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
with gr.Blocks(css=css) as demo:
|
| 104 |
-
with gr.Column(elem_id="col-container"):
|
| 105 |
-
if is_shared_ui:
|
| 106 |
-
top_description = gr.HTML(f'''
|
| 107 |
-
<div class="gr-prose">
|
| 108 |
-
<h2><svg xmlns="http://www.w3.org/2000/svg" width="18px" height="18px" style="margin-right: 0px;display: inline-block;"fill="none"><path fill="#fff" d="M7 13.2a6.3 6.3 0 0 0 4.4-10.7A6.3 6.3 0 0 0 .6 6.9 6.3 6.3 0 0 0 7 13.2Z"/><path fill="#fff" fill-rule="evenodd" d="M7 0a6.9 6.9 0 0 1 4.8 11.8A6.9 6.9 0 0 1 0 7 6.9 6.9 0 0 1 7 0Zm0 0v.7V0ZM0 7h.6H0Zm7 6.8v-.6.6ZM13.7 7h-.6.6ZM9.1 1.7c-.7-.3-1.4-.4-2.2-.4a5.6 5.6 0 0 0-4 1.6 5.6 5.6 0 0 0-1.6 4 5.6 5.6 0 0 0 1.6 4 5.6 5.6 0 0 0 4 1.7 5.6 5.6 0 0 0 4-1.7 5.6 5.6 0 0 0 1.7-4 5.6 5.6 0 0 0-1.7-4c-.5-.5-1.1-.9-1.8-1.2Z" clip-rule="evenodd"/><path fill="#000" fill-rule="evenodd" d="M7 2.9a.8.8 0 1 1 0 1.5A.8.8 0 0 1 7 3ZM5.8 5.7c0-.4.3-.6.6-.6h.7c.3 0 .6.2.6.6v3.7h.5a.6.6 0 0 1 0 1.3H6a.6.6 0 0 1 0-1.3h.4v-3a.6.6 0 0 1-.6-.7Z" clip-rule="evenodd"/></svg>
|
| 109 |
-
Attention: this Space need to be duplicated to work</h2>
|
| 110 |
-
<p class="main-message">
|
| 111 |
-
To make it work, <strong>duplicate the Space</strong> and run it on your own profile using a <strong>private</strong> GPU (T4-small or A10G-small).<br />
|
| 112 |
-
A T4 costs <strong>US$0.60/h</strong>, so it should cost < US$1 to train most models.
|
| 113 |
-
</p>
|
| 114 |
-
<p class="actions">
|
| 115 |
-
<a href="https://huggingface.co/spaces/{os.environ['SPACE_ID']}?duplicate=true">
|
| 116 |
-
<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-lg-dark.svg" alt="Duplicate this Space" />
|
| 117 |
-
</a>
|
| 118 |
-
to start training your own image model
|
| 119 |
-
</p>
|
| 120 |
-
</div>
|
| 121 |
-
|
|
|
|
| 42 |
|
| 43 |
iface.launch()
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|