Spaces:
Sleeping
Sleeping
Commit
·
16ea515
1
Parent(s):
faf7314
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
def create_array(shape):
|
5 |
+
shape = tuple(map(int, shape.split(',')))
|
6 |
+
arr= np.random.randint(0,100, size=shape)
|
7 |
+
return arr
|
8 |
+
|
9 |
+
x=gr.Interface(
|
10 |
+
fn=create_array,
|
11 |
+
inputs="text",
|
12 |
+
outputs="text",
|
13 |
+
title= "Random Array Generator",
|
14 |
+
description= "Enter the shape is the format comma-separated integers (e.g 2,3)"
|
15 |
+
)
|
16 |
+
x.launch()
|