fintech-chatbot / app.py
cuneytkaya's picture
Create app.py
bd82b4d verified
raw
history blame contribute delete
744 Bytes
import gradio as gr
from transformers import T5Tokenizer, T5ForConditionalGeneration
tokenizer = T5Tokenizer.from_pretrained("cuneytkaya/fintech-chatbot-t5")
model = T5ForConditionalGeneration.from_pretrained("cuneytkaya/fintech-chatbot-t5")
def chatbot(input_text):
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(inputs.input_ids)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
interface = gr.Interface(fn=chatbot,
inputs="text",
outputs="text",
title="Fintech Chatbot",
description="This chatbot answers common fintech and banking-related queries.")
interface.launch(share=True)