Spaces:
Sleeping
Sleeping
File size: 634 Bytes
9881414 156180b 9881414 156180b a1c0336 9881414 156180b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | from transformers import pipeline
import gradio as gr
# Load FLAN-T5 model (instruction-following)
generator = pipeline("text2text-generation", model="google/flan-t5-base")
def chat_english_learning(user_input):
prompt = f"{user_input}"
result = generator(prompt, max_length=100, do_sample=False)[0]["generated_text"]
return result
iface = gr.Interface(fn=chat_english_learning,
inputs="text",
outputs="text",
title="English Learning Chatbot",
description="Ask for word meanings, translations, or grammar explanations!")
iface.launch() |