import gradio as gr from transformers import pipeline # Load FinGPT model from Hugging Face model = pipeline("text-generation", model="FinGPT") # Define the chat function def chat(input_text): response = model(input_text, max_length=50, num_return_sequences=1) return response[0]['generated_text'] # Create a Gradio interface iface = gr.Interface(fn=chat, inputs="text", outputs="text", title="FinGPT Chatbot") iface.launch()