Spaces:
Sleeping
Sleeping
Download app.py from vikas2221/QuizVocabVR_chatbot: direct link, hf CLI and curl.
- Browser
- Download file 634 Bytes
-
https://huggingface.co/spaces/vikas2221/QuizVocabVR_chatbot/resolve/main/app.py
- Command line
-
hf download hf://spaces/vikas2221/QuizVocabVR_chatbot/app.py
-
curl -L -o app.py https://huggingface.co/spaces/vikas2221/QuizVocabVR_chatbot/resolve/main/app.py
634 Bytes
| 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() |