app

Gradio app.py

source

ConversationBot

 ConversationBot (verbose=True)

Initialize self. See help(type(self)) for accurate signature.

os.listdir(SAMPLE_IMG_DIR)
SAMPLE_IMG_DIR
Path('/home/evylz/AnimalEquality/lv-recipe-chatbot/assets/images/vegan_ingredients')
from dotenv import load_dotenv
#: eval: false
load_dotenv()
True
CPU times: user 6.19 s, sys: 1.47 s, total: 7.66 s
Wall time: 4.68 s
I uploaded an image that may contain vegan ingredients.
The description of the image is: `a refrigerator with food inside`.
The extracted ingredients are:
```
cabbage lettuce onion
apples
rice
plant-based milk
```

CPU times: user 56.7 s, sys: 63.6 ms, total: 56.8 s
Wall time: 5.95 s

source

create_demo

 create_demo (bot=<class '__main__.ConversationBot'>)
if "demo" in globals():
    demo.close()
demo = create_demo(bot)
demo.launch()
Closing server running on port: 7860
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.