Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,19 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from evodiff.pretrained import OA_DM_38M
|
3 |
+
from evodiff.generate import generate_oaardm
|
4 |
|
5 |
+
checkpoint = OA_DM_38M()
|
6 |
+
model, collater, tokenizer, scheme = checkpoint
|
7 |
+
|
8 |
+
|
9 |
+
def make_seq(seq_len):
|
10 |
+
tokeinzed_sample, generated_sequence = generate_oaardm(model, tokenizer, seq_len, batch_size=1, device='cpu')
|
11 |
+
return generated_sequence
|
12 |
+
|
13 |
+
iface = gr.Interface(
|
14 |
+
fn=make_seq,
|
15 |
+
inputs=gr.Slider(10, 100),
|
16 |
+
outputs="text"
|
17 |
+
)
|
18 |
|
|
|
19 |
iface.launch()
|