File size: 542 Bytes
110343a c570030 110343a c570030 110343a c570030 110343a e163068 110343a e163068 110343a c570030 110343a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | import gradio as gr
from transformers import pipeline
# Model load (stable + public)
generator = pipeline(
"text-generation",
model="distilgpt2"
)
# Chat function
def chat(message):
result = generator(
message,
max_new_tokens=100,
do_sample=True,
temperature=0.7
)
return result[0]["generated_text"]
# Gradio interface (UI minimal, API usable)
demo = gr.Interface(
fn=chat,
inputs=gr.Textbox(placeholder="Type..."),
outputs=gr.Textbox(),
title="ZPRIA AI"
)
demo.launch() |