HMC-CIS-chatbot / app.py
diego2317's picture
Update app.py
179bd30 verified
raw
history blame contribute delete
869 Bytes
import os
import logging
from utils.chatbot_interface4 import ChatbotInterface
# from utils.session_history2 import ChatbotInterface
# Configure logging to the console
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(levelname)s - %(message)s",
handlers=[
logging.StreamHandler()
]
)
if __name__ == "__main__":
try:
# Instantiate the ChatbotInterface class and create the interface
chatbot_interface = ChatbotInterface(
model="gpt-4o-mini",
temperature=0,
max_output_tokens=600,
max_num_results=5
)
demo = chatbot_interface.create_interface()
# Launch the Gradio interface
logging.info("Launching the Gradio interface...")
demo.launch()
except Exception as e:
logging.error(f"An error occurred: {e}")