Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Good defaults
Browse files- src/app.py +1 -7
src/app.py
CHANGED
|
@@ -17,19 +17,13 @@ def change(inp):
|
|
| 17 |
code, explanation, docs = get_text(inp)
|
| 18 |
if inp == "Basic":
|
| 19 |
return (highlight(code), "## Accelerate Code (Base Integration)", explanation, docs)
|
| 20 |
-
# return (templates["initial"], highlight(code), "## Accelerate Code (Base Integration)", explanation, docs)
|
| 21 |
elif inp == "Calculating Metrics":
|
| 22 |
return (highlight(code), f"## Accelerate Code ({inp})", explanation, docs)
|
| 23 |
-
# return (templates["initial_with_metrics"], highlight(code), f"## Accelerate Code ({inp})", explanation, docs)
|
| 24 |
else:
|
| 25 |
return (highlight(code), f"## Accelerate Code ({inp})", explanation, docs)
|
| 26 |
-
# return (templates["accelerate"], highlight(code), f"## Accelerate Code ({inp})", explanation, docs)
|
| 27 |
|
| 28 |
default = change("Basic")
|
| 29 |
|
| 30 |
-
initial_md = gr.Markdown("## Initial Code")
|
| 31 |
-
initial_code = gr.Markdown(templates["initial"])
|
| 32 |
-
|
| 33 |
with gr.Blocks() as demo:
|
| 34 |
inp = gr.Radio(
|
| 35 |
["Basic", "Calculating Metrics", "Checkpointing", "Experiment Tracking", "Gradient Accumulation"],
|
|
@@ -42,7 +36,7 @@ with gr.Blocks() as demo:
|
|
| 42 |
out = gr.Markdown(default[0])
|
| 43 |
with gr.Row():
|
| 44 |
with gr.Column():
|
| 45 |
-
gr.Markdown(
|
| 46 |
explanation = gr.Markdown(default[2])
|
| 47 |
with gr.Row():
|
| 48 |
with gr.Column():
|
|
|
|
| 17 |
code, explanation, docs = get_text(inp)
|
| 18 |
if inp == "Basic":
|
| 19 |
return (highlight(code), "## Accelerate Code (Base Integration)", explanation, docs)
|
|
|
|
| 20 |
elif inp == "Calculating Metrics":
|
| 21 |
return (highlight(code), f"## Accelerate Code ({inp})", explanation, docs)
|
|
|
|
| 22 |
else:
|
| 23 |
return (highlight(code), f"## Accelerate Code ({inp})", explanation, docs)
|
|
|
|
| 24 |
|
| 25 |
default = change("Basic")
|
| 26 |
|
|
|
|
|
|
|
|
|
|
| 27 |
with gr.Blocks() as demo:
|
| 28 |
inp = gr.Radio(
|
| 29 |
["Basic", "Calculating Metrics", "Checkpointing", "Experiment Tracking", "Gradient Accumulation"],
|
|
|
|
| 36 |
out = gr.Markdown(default[0])
|
| 37 |
with gr.Row():
|
| 38 |
with gr.Column():
|
| 39 |
+
gr.Markdown(default[1])
|
| 40 |
explanation = gr.Markdown(default[2])
|
| 41 |
with gr.Row():
|
| 42 |
with gr.Column():
|