trainpy / app.py
jeshwanth93's picture
Create app.py
c155a69 verified
raw
history blame contribute delete
376 Bytes
from transformers import pipeline
import gradio as gr
generator = pipeline("text-generation", model="meta-llama/Llama-3-8B-Instruct")
def chat_with_ai(message):
output = generator(message, max_length=100, do_sample=True)
return output[0]['generated_text']
demo = gr.Interface(fn=chat_with_ai, inputs="text", outputs="text", title="TrainPy Assistant")
demo.launch()