Spaces:
Running
Running
change layout
Browse files
app.py
CHANGED
@@ -69,8 +69,8 @@ TITLE_IMAGE = """
|
|
69 |
"""
|
70 |
|
71 |
TITLE = """
|
72 |
-
<div style="
|
73 |
-
<h1 style="font-weight: 900; margin-bottom: 10px; margin-top: 10px;">
|
74 |
🤗 Optimum Neuron Model Exporter (WIP)
|
75 |
</h1>
|
76 |
</div>
|
@@ -78,11 +78,13 @@ TITLE = """
|
|
78 |
|
79 |
DESCRIPTION = """
|
80 |
Export 🤗 Transformers models hosted on the Hugging Face Hub to AWS Neuron-optimized format for Inferentia/Trainium acceleration.
|
81 |
-
|
|
|
82 |
- Automatically opens PR with Neuron-optimized model
|
83 |
- Preserves original model weights
|
84 |
- Adds proper tags to model card
|
85 |
-
|
|
|
86 |
- PR creation requires the Space owner to have a valid write token set via HF_WRITE_TOKEN
|
87 |
"""
|
88 |
|
@@ -143,26 +145,31 @@ CUSTOM_CSS = """
|
|
143 |
"""
|
144 |
|
145 |
with gr.Blocks(css=CUSTOM_CSS) as demo:
|
|
|
146 |
gr.HTML(TITLE_IMAGE)
|
147 |
gr.HTML(TITLE)
|
148 |
-
|
|
|
|
|
|
|
|
|
149 |
with gr.Row():
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
)
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
|
167 |
btn.click(
|
168 |
fn=neuron_export,
|
|
|
69 |
"""
|
70 |
|
71 |
TITLE = """
|
72 |
+
<div style="text-align: center; max-width: 1400px; margin: 0 auto;">
|
73 |
+
<h1 style="font-weight: 900; margin-bottom: 10px; margin-top: 10px; font-size: 2.2rem;">
|
74 |
🤗 Optimum Neuron Model Exporter (WIP)
|
75 |
</h1>
|
76 |
</div>
|
|
|
78 |
|
79 |
DESCRIPTION = """
|
80 |
Export 🤗 Transformers models hosted on the Hugging Face Hub to AWS Neuron-optimized format for Inferentia/Trainium acceleration.
|
81 |
+
|
82 |
+
**Features:**
|
83 |
- Automatically opens PR with Neuron-optimized model
|
84 |
- Preserves original model weights
|
85 |
- Adds proper tags to model card
|
86 |
+
|
87 |
+
**Note:**
|
88 |
- PR creation requires the Space owner to have a valid write token set via HF_WRITE_TOKEN
|
89 |
"""
|
90 |
|
|
|
145 |
"""
|
146 |
|
147 |
with gr.Blocks(css=CUSTOM_CSS) as demo:
|
148 |
+
# Centered title and image
|
149 |
gr.HTML(TITLE_IMAGE)
|
150 |
gr.HTML(TITLE)
|
151 |
+
|
152 |
+
# Full-width description
|
153 |
+
gr.Markdown(DESCRIPTION)
|
154 |
+
|
155 |
+
# Input controls in a row at the bottom
|
156 |
with gr.Row():
|
157 |
+
input_model = HuggingfaceHubSearch(
|
158 |
+
label="Hub model ID",
|
159 |
+
placeholder="Search for model ID on the hub",
|
160 |
+
search_type="model",
|
161 |
+
)
|
162 |
+
input_task = gr.Textbox(
|
163 |
+
value="auto",
|
164 |
+
max_lines=1,
|
165 |
+
label='Task (can be left to "auto", will be automatically inferred)',
|
166 |
+
)
|
167 |
+
|
168 |
+
# Export button below the inputs
|
169 |
+
btn = gr.Button("Export to Neuron", size="lg")
|
170 |
+
|
171 |
+
# Output section
|
172 |
+
output = gr.Markdown(label="Output")
|
173 |
|
174 |
btn.click(
|
175 |
fn=neuron_export,
|