LOUIS SANNA
feat(docs): explain var env
a50da00

A newer version of the Gradio SDK is available: 4.36.1

Upgrade
metadata
title: AnythingQ&A
emoji: 
colorFrom: blue
colorTo: red
sdk: gradio
sdk_version: 3.48.0
app_file: app.py
pinned: false

Anything Q&A

This tool serves as a customizable version of the amazing ClimateQA by Ekimetrics. It allows you to rapidly create a new question-answering tool using any set of documents as a data source.

Quick Start

  1. Fork the Repository
    Fork the original HuggingFace space: Anything Q&A on HuggingFace.

  2. Set environment variables

For OpenAI API:

OPENAI_API_KEY=...
  1. Install Dependencies

    pip install -r requirements.txt
    
  2. Add your data. Place the PDFs to be used as sources in the data folder. The subfolder and file names will be used as default identifiers by the tool.

    data/
        type_1/
            source_1.pdf
            source_2.pdf
        type_2/
            source_3.pdf
    
  3. Build the index of semantic vectors

    python -m anyqa.build_index
    
  4. Launch the app

    python app.py
    

And you're done!

Deployment

Deploying via Hugging Face Spaces is the most straightforward approach. Simply push your code to a HuggingFace Gradio space, and it will function as is.

You will need to set the environments variables in the settings.

AI providers

The following providers are currently supported:

  • OpenAI
  • Azure OpenAI

The provider is picked based on the variable variables, see example.env.