sukiboo commited on
Commit
349f8b3
1 Parent(s): cae8655

run first code block of app.ipynb

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -1,7 +1,8 @@
1
- import gradio as gr
2
 
3
- def greet(name):
4
- return 'Work in progress, come back later 😴️'
5
-
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
1
+ import json
2
 
3
+ if __name__ == '__main__':
4
+ """Execute the first code block of the app.ipynb notebook."""
5
+ with open('app.ipynb', 'r') as notebook:
6
+ nb = json.load(notebook)
7
+ idxs = [idx for idx, cell in enumerate(nb['cells']) if cell['cell_type']=='code']
8
+ exec(''.join(nb['cells'][idxs[0]]['source']))