ArunAIML's picture
bug in gpt function issue
5ffcda6
raw
history blame
572 Bytes
from transformers import pipeline
import gradio as gr
model_id = "gpt2-large"
pipe = pipeline("text-generation", model=model_id)
def gpt(prompt, top_k, penalty_alpha):
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()