File size: 301 Bytes
acb1bc4
 
8f6f616
acb1bc4
 
 
d6f366b
acb1bc4
 
 
dc4c8e4
 
acb1bc4
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import spaces
from transformers import pipeline

# Load your model
model = pipeline("text-generation", model="gpt2")
model.to("cuda")

@spaces.GPU
def generate_text(prompt):
 return model(prompt)

import gradio as gr
iface = gr.Interface(fn=generate_text, inputs="text", outputs="text")
iface.launch()