hamel commited on
Commit
2f96071
1 Parent(s): 0d8932f
Files changed (2) hide show
  1. app.ipynb +8 -23
  2. app.py +1 -1
app.ipynb CHANGED
@@ -152,7 +152,7 @@
152
  "name": "stdout",
153
  "output_type": "stream",
154
  "text": [
155
- "Running on local URL: http://127.0.0.1:7860\n",
156
  "\n",
157
  "To create a public link, set `share=True` in `launch()`.\n"
158
  ]
@@ -160,7 +160,7 @@
160
  {
161
  "data": {
162
  "text/html": [
163
- "<div><iframe src=\"http://127.0.0.1:7860/\" width=\"500\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
164
  ],
165
  "text/plain": [
166
  "<IPython.core.display.HTML object>"
@@ -172,7 +172,7 @@
172
  {
173
  "data": {
174
  "text/plain": [
175
- "(<gradio.routes.App>, 'http://127.0.0.1:7860/', None)"
176
  ]
177
  },
178
  "execution_count": null,
@@ -183,7 +183,7 @@
183
  "source": [
184
  "#|export\n",
185
  "iface = gr.Interface(fn=size, inputs=gr.Text(value=\"tglcourse/CelebA-faces-cropped-128\"), outputs=\"text\")\n",
186
- "iface.launch(width=500)"
187
  ]
188
  },
189
  {
@@ -204,7 +204,7 @@
204
  "name": "stdout",
205
  "output_type": "stream",
206
  "text": [
207
- "Closing server running on port: 7860\n"
208
  ]
209
  }
210
  ],
@@ -240,21 +240,6 @@
240
  "nb_export('app.ipynb', lib_path='.', name='app')"
241
  ]
242
  },
243
- {
244
- "cell_type": "markdown",
245
- "id": "0182403f-d1d6-48c0-8e66-46aefb23a9ab",
246
- "metadata": {},
247
- "source": [
248
- "<div>\n",
249
- "<link rel=\"stylesheet\" href=\"https://gradio.s3-us-west-2.amazonaws.com/2.6.5/static/bundle.css\">\n",
250
- "<div id=\"target\"></div>\n",
251
- "<script src=\"https://gradio.s3-us-west-2.amazonaws.com/2.6.5/static/bundle.js\"></script>\n",
252
- "<script>\n",
253
- "launchGradioFromSpaces(\"abidlabs/question-answering\", \"#target\")\n",
254
- "</script>\n",
255
- "</div>"
256
- ]
257
- },
258
  {
259
  "cell_type": "markdown",
260
  "id": "84d5fd19-7880-459c-8382-b3574ed11141",
@@ -289,7 +274,7 @@
289
  "\u001b[0;34m\u001b[0m\u001b[0;32mimport\u001b[0m \u001b[0mgradio\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mgr\u001b[0m\u001b[0;34m\u001b[0m\n",
290
  "\u001b[0;34m\u001b[0m\u001b[0;32mfrom\u001b[0m \u001b[0mfastcore\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnet\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0murljson\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mHTTPError\u001b[0m\u001b[0;34m\u001b[0m\n",
291
  "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n",
292
- "\u001b[0;34m\u001b[0m\u001b[0;31m# %% app.ipynb 7\u001b[0m\u001b[0;34m\u001b[0m\n",
293
  "\u001b[0;34m\u001b[0m\u001b[0;32mdef\u001b[0m \u001b[0msize\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrepo\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n",
294
  "\u001b[0;34m\u001b[0m \u001b[0;34m\"Returns the size in GB of a HuggingFace Dataset.\"\u001b[0m\u001b[0;34m\u001b[0m\n",
295
  "\u001b[0;34m\u001b[0m \u001b[0murl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34mf'https://huggingface.co/api/datasets/{repo}'\u001b[0m\u001b[0;34m\u001b[0m\n",
@@ -298,9 +283,9 @@
298
  "\u001b[0;34m\u001b[0m \u001b[0mgb\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mresp\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'size'\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m/\u001b[0m \u001b[0;36m1e9\u001b[0m\u001b[0;34m\u001b[0m\n",
299
  "\u001b[0;34m\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0;34mf'{gb:.2f} GB'\u001b[0m\u001b[0;34m\u001b[0m\n",
300
  "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n",
301
- "\u001b[0;34m\u001b[0m\u001b[0;31m# %% app.ipynb 11\u001b[0m\u001b[0;34m\u001b[0m\n",
302
  "\u001b[0;34m\u001b[0m\u001b[0miface\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mInterface\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msize\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minputs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mgr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mText\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvalue\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"tglcourse/CelebA-faces-cropped-128\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutputs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"text\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n",
303
- "\u001b[0;34m\u001b[0m\u001b[0miface\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlaunch\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mwidth\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m500\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n"
304
  ]
305
  },
306
  "metadata": {},
 
152
  "name": "stdout",
153
  "output_type": "stream",
154
  "text": [
155
+ "Running on local URL: http://127.0.0.1:7861\n",
156
  "\n",
157
  "To create a public link, set `share=True` in `launch()`.\n"
158
  ]
 
160
  {
161
  "data": {
162
  "text/html": [
163
+ "<div><iframe src=\"http://127.0.0.1:7861/\" width=\"500\" height=\"450\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
164
  ],
165
  "text/plain": [
166
  "<IPython.core.display.HTML object>"
 
172
  {
173
  "data": {
174
  "text/plain": [
175
+ "(<gradio.routes.App>, 'http://127.0.0.1:7861/', None)"
176
  ]
177
  },
178
  "execution_count": null,
 
183
  "source": [
184
  "#|export\n",
185
  "iface = gr.Interface(fn=size, inputs=gr.Text(value=\"tglcourse/CelebA-faces-cropped-128\"), outputs=\"text\")\n",
186
+ "iface.launch(height=450, width=500)"
187
  ]
188
  },
189
  {
 
204
  "name": "stdout",
205
  "output_type": "stream",
206
  "text": [
207
+ "Closing server running on port: 7861\n"
208
  ]
209
  }
210
  ],
 
240
  "nb_export('app.ipynb', lib_path='.', name='app')"
241
  ]
242
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  {
244
  "cell_type": "markdown",
245
  "id": "84d5fd19-7880-459c-8382-b3574ed11141",
 
274
  "\u001b[0;34m\u001b[0m\u001b[0;32mimport\u001b[0m \u001b[0mgradio\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mgr\u001b[0m\u001b[0;34m\u001b[0m\n",
275
  "\u001b[0;34m\u001b[0m\u001b[0;32mfrom\u001b[0m \u001b[0mfastcore\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnet\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0murljson\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mHTTPError\u001b[0m\u001b[0;34m\u001b[0m\n",
276
  "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n",
277
+ "\u001b[0;34m\u001b[0m\u001b[0;31m# %% app.ipynb 8\u001b[0m\u001b[0;34m\u001b[0m\n",
278
  "\u001b[0;34m\u001b[0m\u001b[0;32mdef\u001b[0m \u001b[0msize\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrepo\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n",
279
  "\u001b[0;34m\u001b[0m \u001b[0;34m\"Returns the size in GB of a HuggingFace Dataset.\"\u001b[0m\u001b[0;34m\u001b[0m\n",
280
  "\u001b[0;34m\u001b[0m \u001b[0murl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34mf'https://huggingface.co/api/datasets/{repo}'\u001b[0m\u001b[0;34m\u001b[0m\n",
 
283
  "\u001b[0;34m\u001b[0m \u001b[0mgb\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mresp\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'size'\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m/\u001b[0m \u001b[0;36m1e9\u001b[0m\u001b[0;34m\u001b[0m\n",
284
  "\u001b[0;34m\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0;34mf'{gb:.2f} GB'\u001b[0m\u001b[0;34m\u001b[0m\n",
285
  "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n",
286
+ "\u001b[0;34m\u001b[0m\u001b[0;31m# %% app.ipynb 12\u001b[0m\u001b[0;34m\u001b[0m\n",
287
  "\u001b[0;34m\u001b[0m\u001b[0miface\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mInterface\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msize\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minputs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mgr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mText\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvalue\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"tglcourse/CelebA-faces-cropped-128\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutputs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"text\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n",
288
+ "\u001b[0;34m\u001b[0m\u001b[0miface\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlaunch\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mheight\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m450\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mwidth\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m500\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n"
289
  ]
290
  },
291
  "metadata": {},
app.py CHANGED
@@ -18,4 +18,4 @@ def size(repo:str):
18
 
19
  # %% app.ipynb 12
20
  iface = gr.Interface(fn=size, inputs=gr.Text(value="tglcourse/CelebA-faces-cropped-128"), outputs="text")
21
- iface.launch(width=500)
 
18
 
19
  # %% app.ipynb 12
20
  iface = gr.Interface(fn=size, inputs=gr.Text(value="tglcourse/CelebA-faces-cropped-128"), outputs="text")
21
+ iface.launch(height=450, width=500)