ArunAIML's picture
added torch
9df41bd
raw
history blame
564 Bytes
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(
explore_gpt_model,
["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()