Spaces:
Sleeping
Sleeping
File size: 550 Bytes
9df41bd 3ebab61 9df41bd 3ebab61 9df41bd a23d81b 9df41bd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
from transformers import pipeline
import gradio as gr
model_id = "gpt2-large"
pipe = pipeline("text-generation", model=model_id)
def gpt(prompt):
return pipe(prompt, top_k=top_k, penalty_alpha=penalty_alpha)[0]["generated_text"]
gr.Interface(
gpt,
["text",gr.Slider(minimum=0, maximum=50, step=1,label="Top_k"),gr.Slider(minimum=0.1, maximum=1.0,label="penalty_alpha")],
"text",
title= "Arun's GPT chatbot",
description = "This is Arun's experimental GPT interface exposing gpt2-large, feel free to experiment"
).launch()
|