Spaces:
Build error
Build error
import numpy as np | |
import torch | |
import gradio as gr | |
from gradio import mix | |
def set_seed(args): | |
rd = np.random.randint(100000) | |
print('seed =', rd) | |
np.random.seed(rd) | |
torch.manual_seed(rd) | |
if args.n_gpu > 0: | |
torch.cuda.manual_seed_all(rd) | |
title = "ruGPT3 Song Writer" | |
description = "Generate russian songs via fine-tuned ruGPT3" | |
io = gr.Interface.load("models/bankholdup/rugpt3_song_writer") | |
examples = [ | |
['Как дела? Как дела? Это новый кадиллак'] | |
] | |
def inference(text): | |
return io(text) | |
gr.Interface( | |
inference, | |
[gr.inputs.Textbox(label="Input text")], | |
gr.outputs.Textbox(label="Output text"), | |
examples=examples, | |
title=title, | |
description=description, | |
).launch(enable_queue=True,cache_examples=True) | |