Spaces:
Running
Running
File size: 925 Bytes
db541e4 c72f5fe db541e4 c72f5fe affd796 c72f5fe affd796 c4e6ccb affd796 db541e4 affd796 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
import gradio as gr
from evodiff.pretrained import OA_DM_38M
from evodiff.generate import generate_oaardm
checkpoint = OA_DM_38M()
model, collater, tokenizer, scheme = checkpoint
def make_seq(seq_len):
tokeinzed_sample, generated_sequence = generate_oaardm(model, tokenizer, seq_len, batch_size=1, device='cpu')
return generated_sequence
# iface = gr.Interface(
# fn=make_seq,
# inputs=gr.Slider(10, 100),
# outputs="text"
# )
# iface.launch()
with gr.Blocks() as edapp:
gr.Markdown(
"# EvoDiff"
)
with gr.Row():
gr.Markdown(
"""
## Unconditional sequence generation
Generate a sequence with EvoDiff-Seq-OADM 38M
""")
gr.Interface(
fn=make_seq,
inputs=gr.Slider(10, 100, label = "Sequence Length"),
outputs="text"
)
if __name__ == "__main__":
edapp.launch() |