Spaces:
Paused
Paused
deploy 2
Browse files
.DS_Store
DELETED
|
Binary file (6.15 kB)
|
|
|
README.md
CHANGED
|
@@ -1,80 +1,9 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
# Table of Contents
|
| 12 |
-
- [Setting up the bot](#setting-up-the-bot)
|
| 13 |
-
- [Running in a Docker](#running-in-a-docker)
|
| 14 |
-
- [Running in a Python](#running-in-a-python)
|
| 15 |
-
- [Development instructions](#development-instructions)
|
| 16 |
-
- [Datasets](#dataset-list)
|
| 17 |
-
|
| 18 |
-
## Setting up the bot
|
| 19 |
-
First, you need to provide the necessary environmental variables and API keys in the .env file.
|
| 20 |
-
- `HUGGINGFACEHUB_API_TOKEN` - API key for HF Hub
|
| 21 |
-
- `DISCORD_TOKEN` - API key for the bot application
|
| 22 |
-
- `QUESTION_ANSWERING_MODEL_ID` - an ID of a model to be queried from HF Hub (in case of inference through API)
|
| 23 |
-
- `EMBEDDING_MODEL_ID` - an ID of embedding model, used to create and query index on the documents
|
| 24 |
-
- `INDEX_NAME` - directory where the index files are present after creation
|
| 25 |
-
- `USE_DOCS_IN_CONTEXT` - allow context extration from documents
|
| 26 |
-
- `ADD_SOURCES_TO_RESPONSE` - show references to documents that were used as a context for a given query
|
| 27 |
-
- `USE_MESSEGES_IN_CONTEXT` - allow to use chat history for conversational experience
|
| 28 |
-
- `NUM_LAST_MESSAGES` - number of messages used for the previous feature
|
| 29 |
-
- `USE_NAMES_IN_CONTEXT` - use names of users in context
|
| 30 |
-
- `ENABLE_COMMANDS` - allow command, e.g. channel cleanup
|
| 31 |
-
- `DEBUG` - provides additional logging
|
| 32 |
-
|
| 33 |
-
If you decide that you want to **run everthing locally** our current MVP recommends using Instructor large and Alpaca 7B with 4-bit quatization models. For this to properly work, you need to put the weights of the model in the `/bot/question_answering/` and set the `QUESTION_ANSWERING_MODEL_ID` variable to the name of the file that you just put in the aforementioned folder. Now, you should be able to run your own, local instance of the bot.
|
| 34 |
-
|
| 35 |
-
### Running in a Docker
|
| 36 |
-
```bash
|
| 37 |
-
docker build -t <container-name> .
|
| 38 |
-
docker run <container-name>
|
| 39 |
-
# or simply:
|
| 40 |
-
./run_docker.sh
|
| 41 |
-
```
|
| 42 |
-
|
| 43 |
-
### Running in a Python
|
| 44 |
-
```bash
|
| 45 |
-
pip install -r requirements.txt
|
| 46 |
-
python3 -m bot
|
| 47 |
-
```
|
| 48 |
-
|
| 49 |
-
## Development Instructions
|
| 50 |
-
|
| 51 |
-
We use `Python 3.10`
|
| 52 |
-
|
| 53 |
-
To install all necessary Python packages, run the following command:
|
| 54 |
-
|
| 55 |
-
```bash
|
| 56 |
-
pip install -r requirements.txt
|
| 57 |
-
```
|
| 58 |
-
We use the pipreqsnb to generate the requirements.txt file. To install pipreqsnb, run the following command:
|
| 59 |
-
|
| 60 |
-
```bash
|
| 61 |
-
pip install pipreqsnb
|
| 62 |
-
```
|
| 63 |
-
To generate the requirements.txt file, run the following command:
|
| 64 |
-
|
| 65 |
-
```bash
|
| 66 |
-
pipreqsnb --force .
|
| 67 |
-
```
|
| 68 |
-
|
| 69 |
-
To run unit tests, you can use the following command:
|
| 70 |
-
|
| 71 |
-
```bash
|
| 72 |
-
pytest -o "testpaths=tests" --noconftest
|
| 73 |
-
```
|
| 74 |
-
|
| 75 |
-
## Dataset List
|
| 76 |
-
|
| 77 |
-
Below is a list of the datasets used during development:
|
| 78 |
-
- [Stack Overflow - Python](https://huggingface.co/datasets/KonradSzafer/stackoverflow_python_preprocessed)
|
| 79 |
-
- [Stack Overflow - Linux](https://huggingface.co/datasets/KonradSzafer/stackoverflow_linux)
|
| 80 |
-
- [Hugging Face Documentation](https://huggingface.co/docs)
|
|
|
|
| 1 |
+
title: Bot
|
| 2 |
+
emoji: 🏢
|
| 3 |
+
colorFrom: indigo
|
| 4 |
+
colorTo: indigo
|
| 5 |
+
sdk: gradio
|
| 6 |
+
sdk_version: 3.36.1
|
| 7 |
+
app_file: app.py
|
| 8 |
+
pinned: false
|
| 9 |
+
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|