import gradio as gr import torch # Load the model model = torch.load("chatbot_model.pt") # Adjust as needed # Define the chatbot function def chatbot(input_text): # Use your model inference function here response = get_response(input_text) # Call to your response function return response # Define the Gradio interface iface = gr.Interface( fn=chatbot, # The function that will be called inputs="text", # User will input text outputs="text" # Model will output text ) # Launch the app iface.launch()