Spaces:
Sleeping
Sleeping
dummy app
Browse files
app.py
CHANGED
@@ -1,12 +1,22 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
5 |
|
6 |
demo = gr.Interface(
|
7 |
fn=greet,
|
8 |
-
inputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
outputs=["text"],
|
10 |
)
|
11 |
|
12 |
-
demo.launch(
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
import numpy as np
|
4 |
+
|
5 |
+
def greet (word, sentence, model, layer, norm):
|
6 |
+
inputs = [word, sentence, model, str(layer), norm]
|
7 |
+
outputs = [input+'\t'+str(np.random.randint(0,100, size=1)[0]) for input in inputs]
|
8 |
+
return "\n".join(outputs)
|
9 |
|
10 |
demo = gr.Interface(
|
11 |
fn=greet,
|
12 |
+
inputs=[
|
13 |
+
"text",
|
14 |
+
"text",
|
15 |
+
gr.Radio(["bert", "gpt2"]),
|
16 |
+
"number",
|
17 |
+
gr.Radio(["Binder", "McRae", "Buchanan"]),
|
18 |
+
],
|
19 |
outputs=["text"],
|
20 |
)
|
21 |
|
22 |
+
demo.launch()
|