This Gradio-based web app allows you to interact with the CentML Serverless API . It streams the assistant’s responses in real-time, providing a conversational interface where users can chat with an AI assistant.
To run the Gradio app, execute the following command:
Copy
python app.py
This will launch a local Gradio interface in your browser. If the app doesn’t open automatically, you can access it by navigating to the URL shown in your terminal (usually http://127.0.0.1:7860/). You will also get a free 72 hour public URL to share and use from anywhere.
Model: If you want to change the model or parameters such as temperature or max_tokens, you can modify the data dictionary in the send_message function in app.py.
UI Layout: You can adjust the layout of the interface by modifying the Gradio components in the gr.Blocks section.
Error Connecting to API: If you encounter an error connecting to the CentML API, ensure that your API key is valid and set in the environment variable CENTML_API_KEY.
Python Version: Ensure you are using Python 3.8 or higher.
Dependencies: Make sure you have installed all the necessary dependencies (Gradio and Requests).