File size: 345 Bytes
a498ca8
 
 
 
 
 
 
1acc2f3
 
a498ca8
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import torch
from transformers import pipeline
import gradio as gr

pipe = pipeline("text-generation", model="MTSAIR/multi_verse_model")

def greet(name):
    res = pipe(name, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
    return res[0]['generated_text']

iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()