import gradio as gr | |
class TafGPT: | |
def generate_response(self, user_input): | |
# Replace this with your own logic or use external APIs for more advanced responses | |
response = f"Taf-gpt: Thank you for your input: '{user_input}'. I'm a simple chatbot for now." | |
return response | |
# Create an instance of TafGPT | |
taf_gpt = TafGPT() | |
# Define Gradio interface | |
iface = gr.Interface( | |
fn=taf_gpt.generate_response, | |
inputs="text", | |
outputs="text", | |
live=True, | |
title="Taf-gpt Chatbot", | |
description="Welcome to Taf-gpt! Enter your message below.", | |
) | |
# Launch the Gradio interface | |
iface.launch() |