alan-turing-institute / reginald

Reginald repository for REG Hack Week 23
3 stars 0 forks source link

Add try-except to loading in the data index #123

Open rchan26 opened 11 months ago

rchan26 commented 11 months ago

When running the CLI reginald_run to set up slack bot with a llama-index model, you get error when you don't have the index built (i.e. the correct folder doesn't exist in your data directory) in which case you need to build the index by using --force-new-index flag. We could have better error handling.

Either:

The specific lines of code to change are here: https://github.com/alan-turing-institute/reginald/blob/1f54b29a05318b876cef0ba1ea878bbed99da0c1/reginald/models/models/llama_index.py#L146-L168

Note: consider the folder may not exist because the data directory was misspecified, so perhaps the first suggestion is not ideal.