DebasishDhal99 commited on
Commit
1da4f55
1 Parent(s): 0dfb40d

Generating image

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2,7 +2,6 @@ import matplotlib.pyplot as plt
2
  import random
3
  import gradio as gr
4
 
5
-
6
  def generate_random_walk(iters):
7
  directions = ['east', 'north', 'north', 'south']
8
  start_point = [0, 0]
@@ -64,7 +63,8 @@ def generate_random_walk(iters):
64
  buf.seek(0)
65
 
66
  return buf.read()
 
67
 
68
  # Create a Gradio interface
69
- iface = gr.Interface(fn=generate_random_walk, inputs="text", outputs="image", title="Random Walk Plot")
70
  iface.launch()
 
2
  import random
3
  import gradio as gr
4
 
 
5
  def generate_random_walk(iters):
6
  directions = ['east', 'north', 'north', 'south']
7
  start_point = [0, 0]
 
63
  buf.seek(0)
64
 
65
  return buf.read()
66
+ iters = gr.inputs.Textbox(label="Number of random steps")
67
 
68
  # Create a Gradio interface
69
+ iface = gr.Interface(fn=generate_random_walk, inputs=iters, outputs="image", title="Random Walk Plot")
70
  iface.launch()