evodiff / app.py
colbyford's picture
Update app.py
c72f5fe
raw
history blame
460 Bytes
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()