aliabd HF Staff commited on
Commit
efdb9db
·
1 Parent(s): 065a4f3

Upload with huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +1 -1
  2. requirements.txt +1 -1
  3. run.ipynb +1 -1
  4. run.py +5 -2
README.md CHANGED
@@ -5,7 +5,7 @@ emoji: 🔥
5
  colorFrom: indigo
6
  colorTo: indigo
7
  sdk: gradio
8
- sdk_version: 3.19.0
9
  app_file: run.py
10
  pinned: false
11
  ---
 
5
  colorFrom: indigo
6
  colorTo: indigo
7
  sdk: gradio
8
+ sdk_version: 3.19.1
9
  app_file: run.py
10
  pinned: false
11
  ---
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
 
2
- https://gradio-main-build.s3.amazonaws.com/c3a40dabf53da761841a9a7f59243853a3062926/gradio-3.19.0-py3-none-any.whl
 
1
 
2
+ https://gradio-main-build.s3.amazonaws.com/ab25bcc96739202c552bc5eab7950528f79eb6b3/gradio-3.19.1-py3-none-any.whl
run.ipynb CHANGED
@@ -1 +1 @@
1
- {"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: blocks_flipper"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import numpy as np\n", "import gradio as gr\n", "\n", "def flip_text(x):\n", " return x[::-1]\n", "\n", "def flip_image(x):\n", " return np.fliplr(x)\n", "\n", "with gr.Blocks() as demo:\n", " gr.Markdown(\"Flip text or image files using this demo.\")\n", " with gr.Tab(\"Flip Text\"):\n", " text_input = gr.Textbox()\n", " text_output = gr.Textbox()\n", " text_button = gr.Button(\"Flip\")\n", " with gr.Tab(\"Flip Image\"):\n", " with gr.Row():\n", " image_input = gr.Image()\n", " image_output = gr.Image()\n", " image_button = gr.Button(\"Flip\")\n", "\n", " with gr.Accordion(\"Open for More!\"):\n", " gr.Markdown(\"Look at me...\")\n", "\n", " text_button.click(flip_text, inputs=text_input, outputs=text_output)\n", " image_button.click(flip_image, inputs=image_input, outputs=image_output)\n", " \n", "if __name__ == \"__main__\":\n", " demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
 
1
+ {"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: blocks_flipper"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import numpy as np\n", "import gradio as gr\n", "\n", "\n", "def flip_text(x):\n", " return x[::-1]\n", "\n", "\n", "def flip_image(x):\n", " return np.fliplr(x)\n", "\n", "\n", "with gr.Blocks() as demo:\n", " gr.Markdown(\"Flip text or image files using this demo.\")\n", " with gr.Tab(\"Flip Text\"):\n", " text_input = gr.Textbox()\n", " text_output = gr.Textbox()\n", " text_button = gr.Button(\"Flip\")\n", " with gr.Tab(\"Flip Image\"):\n", " with gr.Row():\n", " image_input = gr.Image()\n", " image_output = gr.Image()\n", " image_button = gr.Button(\"Flip\")\n", "\n", " with gr.Accordion(\"Open for More!\"):\n", " gr.Markdown(\"Look at me...\")\n", "\n", " text_button.click(flip_text, inputs=text_input, outputs=text_output)\n", " image_button.click(flip_image, inputs=image_input, outputs=image_output)\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
run.py CHANGED
@@ -1,12 +1,15 @@
1
  import numpy as np
2
  import gradio as gr
3
 
 
4
  def flip_text(x):
5
  return x[::-1]
6
 
 
7
  def flip_image(x):
8
  return np.fliplr(x)
9
 
 
10
  with gr.Blocks() as demo:
11
  gr.Markdown("Flip text or image files using this demo.")
12
  with gr.Tab("Flip Text"):
@@ -24,6 +27,6 @@ with gr.Blocks() as demo:
24
 
25
  text_button.click(flip_text, inputs=text_input, outputs=text_output)
26
  image_button.click(flip_image, inputs=image_input, outputs=image_output)
27
-
28
  if __name__ == "__main__":
29
- demo.launch()
 
1
  import numpy as np
2
  import gradio as gr
3
 
4
+
5
  def flip_text(x):
6
  return x[::-1]
7
 
8
+
9
  def flip_image(x):
10
  return np.fliplr(x)
11
 
12
+
13
  with gr.Blocks() as demo:
14
  gr.Markdown("Flip text or image files using this demo.")
15
  with gr.Tab("Flip Text"):
 
27
 
28
  text_button.click(flip_text, inputs=text_input, outputs=text_output)
29
  image_button.click(flip_image, inputs=image_input, outputs=image_output)
30
+
31
  if __name__ == "__main__":
32
+ demo.launch()