Spaces:
Runtime error
Runtime error
File size: 468 Bytes
f85ee0f 3341c9c c153d9e 3341c9c f85ee0f 3341c9c c153d9e 908245b c153d9e 3341c9c c153d9e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
from transformers import pipeline
import gradio as gr
pipe = pipeline(
"text-generation",
model="EleutherAI/MPT-7B-Instruct" # or MPT-7B-Instruct for better results
)
def chat(user_input):
output = pipe(
user_input,
max_length=100,
do_sample=True,
top_k=50,
top_p=0.9,
temperature=0.6
)[0]['generated_text']
return output
demo = gr.Interface(fn=chat, inputs="text", outputs="text")
demo.launch()
|