Spaces:
Running
on
Zero
Running
on
Zero
Aditya Sahu
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -223,10 +223,11 @@ footer, .gradio-footer, .svelte-1ipelgc, .gradio-logo, .gradio-app__settings {
|
|
| 223 |
with gr.Blocks(css=custom_css) as demo:
|
| 224 |
gr.Markdown("<h1 style='font-size:2.5em; color:#007dc3; margin-bottom:0;'>SR100 Model Compiler</h1>", elem_id="main_title")
|
| 225 |
gr.Markdown("<h3 style='margin-top:0; color:#000;'>Bring a TFlite INT8 model and compile it for Synaptics Astra SR100. Learn more at <a href='https://developer.synaptics.com/docs/sr/sr100/quick-start?utm_source=hf' target='_blank' style='color:#007dc3; text-decoration:underline;'>Synaptics AI Developer Zone</a></h3>", elem_id="subtitle")
|
|
|
|
| 226 |
|
| 227 |
with gr.Row():
|
| 228 |
-
vmem_slider = gr.Slider(minimum=
|
| 229 |
-
lpmem_slider = gr.Slider(minimum=
|
| 230 |
|
| 231 |
model_dropdown = gr.Dropdown(
|
| 232 |
label="Select a model",
|
|
@@ -235,7 +236,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 235 |
)
|
| 236 |
|
| 237 |
# Add file upload component
|
| 238 |
-
model_upload = gr.File(label="Or upload a .tflite INT8 model", file_types=[".tflite"], file_count="single")
|
| 239 |
|
| 240 |
# Run the compile
|
| 241 |
compile_btn = gr.Button("Compile Model")
|
|
@@ -245,13 +246,12 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 245 |
compile_btn.click(compile_model, inputs=[model_dropdown, vmem_slider, lpmem_slider, model_upload], outputs=[compile_text])
|
| 246 |
|
| 247 |
gr.HTML("""
|
| 248 |
-
<div style="max-width:
|
| 249 |
For a detailed walkthrough, please see our
|
| 250 |
-
<a href="
|
| 251 |
-
|
| 252 |
-
<a href="http://localhost:3000/sr/quick-start" target="_blank" style="color: #1a0dab;">SR Quick Start page</a>.
|
| 253 |
</div>
|
| 254 |
""")
|
| 255 |
|
| 256 |
if __name__ == "__main__":
|
| 257 |
-
demo.launch()
|
|
|
|
| 223 |
with gr.Blocks(css=custom_css) as demo:
|
| 224 |
gr.Markdown("<h1 style='font-size:2.5em; color:#007dc3; margin-bottom:0;'>SR100 Model Compiler</h1>", elem_id="main_title")
|
| 225 |
gr.Markdown("<h3 style='margin-top:0; color:#000;'>Bring a TFlite INT8 model and compile it for Synaptics Astra SR100. Learn more at <a href='https://developer.synaptics.com/docs/sr/sr100/quick-start?utm_source=hf' target='_blank' style='color:#007dc3; text-decoration:underline;'>Synaptics AI Developer Zone</a></h3>", elem_id="subtitle")
|
| 226 |
+
gr.Markdown("<p style='margin-top:0; color:#000; font-style:italic;'>Please note: VMEM is fast memory, LPMEM is slow memory. Always make sure the Arena cache size is less than the VMEM for the model to fit correctly.</p>", elem_id="memory_note")
|
| 227 |
|
| 228 |
with gr.Row():
|
| 229 |
+
vmem_slider = gr.Slider(minimum=1, maximum=1536, step=1.024, label="Set total VMEM SRAM size available in kB", value=1536.0)
|
| 230 |
+
lpmem_slider = gr.Slider(minimum=1, maximum=1536, step=1.024, label="Set total LPMEM SRAM size in kB", value=1536.0)
|
| 231 |
|
| 232 |
model_dropdown = gr.Dropdown(
|
| 233 |
label="Select a model",
|
|
|
|
| 236 |
)
|
| 237 |
|
| 238 |
# Add file upload component
|
| 239 |
+
model_upload = gr.File(label="Or upload a .tflite INT8 model. Please note, Uploaded models are stored in a temporary directory and will be deleted automatically after processing.", file_types=[".tflite"], file_count="single")
|
| 240 |
|
| 241 |
# Run the compile
|
| 242 |
compile_btn = gr.Button("Compile Model")
|
|
|
|
| 246 |
compile_btn.click(compile_model, inputs=[model_dropdown, vmem_slider, lpmem_slider, model_upload], outputs=[compile_text])
|
| 247 |
|
| 248 |
gr.HTML("""
|
| 249 |
+
<div style="max-width: 900px; margin: 2rem auto; background: white; color: black; border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); border: 1px solid #e5e7eb; padding: 1.5rem; text-align: center;">
|
| 250 |
For a detailed walkthrough, please see our
|
| 251 |
+
<a href="https://developer.synaptics.com/docs/sr/sr100/evaluate-sr?utm_source=hf" target="_blank" style="color: #1a0dab;">Evaluate Model Guide</a>.<br>
|
| 252 |
+
This Space uses a simulation toolchain to estimate model performance providing results that closely reflect real hardware behavior.
|
|
|
|
| 253 |
</div>
|
| 254 |
""")
|
| 255 |
|
| 256 |
if __name__ == "__main__":
|
| 257 |
+
demo.launch()
|