Spaces:
Runtime error
Runtime error
| 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() | |