Spaces:
Build error
Build error
File size: 5,271 Bytes
00fc922 3bfc509 00fc922 60f2811 00fc922 2c73924 08606a2 80fcc8f dbf9cc9 a45dc95 f83c56a 80fcc8f 8cdd0c9 75bfa09 a45dc95 a5cbc9a 08606a2 2c73924 a45dc95 2c73924 5f033af a45dc95 5f033af 2c73924 3c67a3e af26bab 5f033af 2c73924 5f033af 08606a2 a5cbc9a ff2d6c7 75bfa09 08606a2 ff2d6c7 08606a2 4acfa39 75bfa09 4acfa39 5f033af 75bfa09 08606a2 5f033af 75bfa09 08606a2 60a59c6 ef96aaf 2c73924 8cdd0c9 2c73924 afeec9a b7700e2 afeec9a 2c73924 ef96aaf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
---
title: "ChatBot: learn about André's research through an AI assistant"
colorFrom: indigo
colorTo: indigo
sdk: streamlit
sdk_version: 1.27.2
app_port: 8501
emoji: 💬
pinned: false
license: mit
app_file: app.py
---
# [chatbot-streamlit-demo](https://github.com/andreped/chatbot-streamlit-demo#chatbot-streamlit-demo)
[](https://opensource.org/licenses/MIT)
<a target="_blank" href="https://huggingface.co/spaces/andreped/chatbot-streamlit-demo"><img src="https://img.shields.io/badge/🤗%20Hugging%20Face-Spaces-yellow.svg"></a>
[](https://chatbot-app-demo.streamlit.app)
[](https://github.com/andreped/chatbot-streamlit-demo/actions/workflows/deploy.yml)
This application demonstrates how to setup a simple ChatBot with [Azure OpenAI](https://azure.microsoft.com/en-us/products/ai-services/openai-service), [llama-index](https://docs.llamaindex.ai/en/stable/), and [Streamlit](https://streamlit.io).
The final app is also deployed on both [Streamlit](https://chatbot-app-demo.streamlit.app) and [Hugging Face Spaces](https://huggingface.co/spaces/andreped/chatbot-streamlit-demo), as well as embedded into a [personal website](https://andreped.github.io/demos/2023/chatbot/).
The ChatBot enables you to talk with your own data - in this case, to learn about [André's research](https://scholar.google.com/citations?user=U20zUHQAAAAJ).
## [Continuous integration](https://github.com/andreped/chatbot-streamlit-demo#continuous-integration)
| Build Type | Status |
| - | - |
| **HF Deploy** | [](https://github.com/andreped/chatbot-streamlit-demo/actions) |
| **File size check** | [](https://github.com/andreped/chatbot-streamlit-demo/actions) |
| **Linting** | [](https://github.com/andreped/chatbot-streamlit-demo/actions) |
## [Demo](https://github.com/andreped/chatbot-streamlit-demo#demo)
We have enabled live hosting through both Streamlit and Hugging Face spaces. Click on the respective badges below to access each:
#### [Hugging Face Spaces](https://github.com/andreped/chatbot-streamlit-demo#hugging-face-spaces) <a target="_blank" href="https://huggingface.co/spaces/andreped/chatbot-streamlit-demo"><img src="https://img.shields.io/badge/🤗%20Hugging%20Face-Spaces-yellow.svg"></a>

#### [Streamlit](https://github.com/andreped/chatbot-streamlit-demo#Streamlit) [](https://chatbot-app-demo.streamlit.app)

## [Development](https://github.com/andreped/chatbot-streamlit-demo#Development)
If you wish to play around with the app locally, it requires that you provide OpenAI API key and all that fun stuff yourself.
These instructions were tested on a MacBook Pro with M2 chip running macOS 13.6 Ventura with `Python 3.9.6`.
1. Setup virtual environment and install dependencies:
```
python3 -m venv venv/
source venv/bin/activate
pip install -r requirements.txt
```
2. Create the secrets file at `.streamlit/secrets.toml` and fill in the relevant info:
```
OPENAI_API_KEY = "<insert OpenAI API key>"
CHATGPT_MODEL = "<insert model name>"
OPENAI_API_BASE = "https://<insert-openai-service-name>.openai.azure.com"
OPENAI_API_VERSION = "<insert version>"
ENGINE = "<insert deployment model name>"
ENGINE_EMBEDDING = "<insert deployment embedding name>"
```
3. Launch the app:
```
streamlit run app.py
```
A Streamlit browser window should automatically open. If not, the app can be accessed at `http://localhost:8501`
## [Disclaimer](https://github.com/andreped/chatbot-streamlit-demo#disclaimer)
Only public PDFs were used for this demonstration. Some of André's research is sadly behind a paywall and thus we have chosen not to include the PDFs in this demo to avoid copyright issues.
## [Acknowledgements](https://github.com/andreped/chatbot-streamlit-demo#acknowledgements)
I wish to acknowledge [Sopra Steria](https://www.soprasteria.com) for giving me the chance to develop this web application on internal time. I also want to praise [OpenAI](https://openai.com), [Microsoft Azure](https://azure.microsoft.com/en-us), and the developers of [llama-index](https://www.llamaindex.ai), [Streamlit](https://streamlit.io), and [HuggingFace](https://huggingface.co) for making such great tools to develop applications in.
## [License](https://github.com/andreped/chatbot-streamlit-demo#license)
The code in this repository is released under [MIT license](https://github.com/andreped/chatbot-streamlit-demo/blob/main/LICENSE).
|