File size: 487 Bytes
8b535b2 3ce9516 8b535b2 3ce9516 7198773 8b535b2 3ce9516 7198773 3ce9516 7198773 3ce9516 7198773 3ce9516 7198773 | 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 | import gradio as gr
from transformers import pipeline
pipe = pipeline(
"text-generation",
model="lazarus19/OpenHusky"
)
def chat(message):
result = pipe(
message,
max_new_tokens=128,
do_sample=True,
temperature=0.7
)
return result[0]["generated_text"]
demo = gr.Interface(
fn=chat,
inputs=gr.Textbox(label="Message"),
outputs=gr.Textbox(label="Response"),
title="OpenHusky"
)
demo.launch() |