GithubHelp home page GithubHelp logo

feedback-guard's Introduction

๐Ÿค–โ„๏ธ Snowflake Arctic Chatbot

This Streamlit app is not just any chatbot; it's your starter kit to play with Snowflake's brand new foundation model: Snowflake Arctic! Arctic was released on April 24, 2024 and is completely open-source ๐Ÿ˜

Get the full lowdown on Arctic in Adrien Treuille's blog post. Snowflake Arctic is also available via Hugging Face ๐Ÿค— and all your favorite model gardens soon! ๐Ÿ”œ

Built a cool Streamlit app using Arctic? Share it on social media with #SnowflakeArctic! We'll repost you ๐Ÿซก

Streamlit app chatbot for Snowflake Arctic

Getting your own Replicate API token

To use this app, you'll need to get your own Replicate API token.

After creating a Replicate account, you can access your API token from this page.

Setup Instructions

Prerequisites

  • Python 3.8 or later ๐Ÿ
  • pip3 ๐Ÿ“ฆ

Installation

  1. Clone this repository

    git clone https://github.com/yourusername/snowflake-arctic-chatbot.git
    cd snowflake-arctic-chatbot
  2. Install requirements

       pip install -r requirements.txt
  3. Add your API token to your secrets file
    Create a .streamlit folder with a secrets.toml file inside.

    mkdir .streamlit
    cd .streamlit
    touch secrets.toml

    Use your text editor or IDE of choice to add the following to secrets.toml:

    REPLICATE_API_TOKEN = "your API token here"

    Learn more about Streamlit secrets management in our docs.

    Alternatively, you can enter your Replicate API token via the st.text_input widget in the app itself (once you're running the app).

  4. Run the Streamlit app Note: there are two versions of the app included in this repo. simple_app.py is a simpler app which passes user input to Arctic and returns Arctic's response. streamlit_app.py has built-in guardrails, meaning that it checks user input to ensure queries are safe (i.e. users are not asking Arctic for instructions on how to commit illegal activity, etc.).

To run the version of the app that includes guardrails, enter:

cd ..
streamlit run streamlit_app.py

To run the simpler version of the app, enter:

cd ..
streamlit run simple_app.py

Deployment

Host your app for free on Streamlit Community Cloud. These instructions are also available in our docs.

  1. Sign up for a Community Cloud account or log in at share.streamlit.io.
  2. Click "New app" from the upper-right corner of your workspace.
  3. Fill in your repo, branch, and file path. As a shortcut, you can also click "Paste GitHub URL" to paste a link directly to streamlit_app.py on GitHub.

Optional: store your Replicate API token with Community Cloud secrets

Securely store your Replicate API token with Community Cloud's secrets management feature. These instructions are also available in our docs.

Add secrets before deploying
  1. Before clicking "Deploy", click "Advanced settings..."
  2. A modal will appear with an input box for your secrets.
  3. Provide your secrets in the "Secrets" field using TOML format. For example:
    REPLICATE_API_TOKEN = "your API token here"
Add secrets after deploying
  1. Go to share.streamlit.io.
  2. Click the overflow menu icon (AKA hamburger icon) for your app.
  3. Click "Settings".
  4. A modal will appear. Click "Secrets" on the left.
  5. After you edit your secrets, click "Save". It might take a minute for the update to be propagated to your app, but the new values will be reflected when the app re-runs.

Support

Need help? Got a burning question or a spark of genius to share? Just open an issue in this repository.

feedback-guard's People

Contributors

adityakommu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.