This project sets up a Streamlit app for extracting invoice information using the Gemini model.
-
Dependencies Installation: Install the required dependencies by running
pip install -r requirements.txt
. -
Google API Key: Obtain a Google API key and store it in the environment variable
GOOGLE_API_KEY
. -
Run the App: Execute the
main()
function to run the Streamlit app.
-
Input Prompt: Enter the input prompt in the provided text input field.
-
Image Upload: Upload an image of the invoice.
-
Search: Click on the "Search" button to generate the response based on the input prompt and uploaded image.
-
Response Display: The response generated by the Gemini model will be displayed below the "Search" button.
-
load_key()
: Loads the Google API key from the environment variable. -
gemini_init(model_type='gemini-pro-vision')
: Initializes a GenerativeModel object using the specified model type. -
get_response(model, image, user_prompt, input_prompt=input_prompt)
: Generates content based on the prompts and returns the generated response as a string. -
main()
: Sets up a Streamlit app for extracting invoice information using the Gemini model.
src/
: Contains the source code files.prompt.py
: Provides input prompt.
README.md
: Documentation file.requirements.txt
: Lists the project dependencies.
This project is licensed under the MIT License.