--- title: Falcon 40B Instruct Chat emoji: 🦅💬🤖 colorFrom: yellow colorTo: blue sdk: gradio sdk_version: 4.41.0 app_file: app.py pinned: false license: afl-3.0 --- # Falcon-40B-Instruct-Chat App This is an AI-powered chatbot application built using Gradio and Hugging Face's Falcon-40B-Instruct model. The chatbot enables users to engage in dynamic conversations with an AI assistant, with options for customizing the assistant’s behavior, such as adjusting the system message and temperature settings. ## Features - **Dynamic Conversations**: The chatbot maintains chat history and responds dynamically based on user inputs and prior conversation. - **Customizable System Message**: Users can modify the system message (instruction) to change how the AI responds. For example, you can guide the assistant to be formal, casual, or focused on specific tasks. - **Adjustable Temperature**: Control the creativity of the responses with a temperature slider. Higher values make the responses more diverse, while lower values generate more deterministic answers. - **Clear Chat History**: Easily reset the conversation and start a fresh chat session with the "Clear console" button. - **Streamed Responses**: Enjoy interactive, token-by-token response streaming, making the conversation feel more natural. ## How It Works 1. **Input a Prompt**: Users can enter a message in the prompt textbox and submit it either by pressing Enter or clicking the "Submit" button. 2. **Chatbot Response**: The chatbot generates responses based on the input and the conversation history, maintaining context across multiple turns. 3. **System Message**: In the advanced options, users can modify the "System message" to change how the AI responds. For instance, you can instruct the AI to be more formal or humorous. 4. **Temperature Control**: The temperature slider allows you to adjust the response's randomness, where 1.0 produces more creative responses and lower values (e.g., 0.1) lead to more focused, deterministic outputs. 5. **Clear Button**: Use the "Clear console" button to reset the conversation history and start fresh. ## Customization - **System Message**: Customize the system message to guide how the assistant behaves (e.g., helpful, formal, or humorous). - **Temperature**: Adjust the temperature slider to control the variability and creativity of the responses. A higher temperature means more creative, diverse answers, while a lower temperature makes responses more focused and precise. ## Usage - **Submit a Prompt**: Type your message into the "Prompt" textbox and press "Submit" or hit Enter to engage with the chatbot. - **Modify System Behavior**: Change the system message in the advanced options to guide the assistant's behavior. - **Adjust Temperature**: Use the slider to modify the temperature and control the level of creativity in the responses. - **Clear Chat**: Reset the chat history using the "Clear console" button. ## Dependencies - **Gradio**: Used for creating the interactive user interface. - **Spaces**: Utilized for GPU acceleration during model execution. - **Transformers**: Powered by the Hugging Face Falcon-40B-Instruct model. - **Python**: The programming language used for the app’s backend logic.