Spaces:
Runtime error
Runtime error
import gradio as gr | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from torch.autograd import Variable | |
import torch.optim as optim | |
import kornia.augmentation as K | |
from CLIP import clip | |
from torchvision import transforms | |
from PIL import Image | |
import numpy as np | |
import math | |
from matplotlib import pyplot as plt | |
from fastprogress.fastprogress import master_bar, progress_bar | |
from IPython.display import HTML | |
from base64 import b64encode | |
def generate(text, n_steps): | |
#todo | |
return np.random.random((128, 128, 3)).astype(np.uint8) | |
iface = gr.Interface(fn=generate, | |
inputs=[ | |
gr.inputs.Textbox(label="Text Input"), | |
gr.inputs.Number(default=42, label="N Steps") | |
], | |
outputs=[ | |
gr.outputs.Image(type="numpy", label="Output Image") | |
], | |
).launch() |