Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,8 +9,8 @@ import time
|
|
| 9 |
from bs4 import BeautifulSoup
|
| 10 |
|
| 11 |
specialtoken=os.getenv("SPECIALTOKEN")
|
| 12 |
-
|
| 13 |
-
plants = ["Echinacea", "Ginkgo biloba", "Turmeric"]
|
| 14 |
|
| 15 |
PROMPT_TEMPLATE = """
|
| 16 |
Extract plant information from the following content in JSON format with these keys:
|
|
@@ -142,14 +142,15 @@ with gr.Blocks(title="AI-Powered Medicinal Plants Database") as app:
|
|
| 142 |
plant_input = gr.Textbox(label="Plant Names",
|
| 143 |
placeholder="e.g., Neem, Peppermint, Aloe Vera")
|
| 144 |
fetch_btn = gr.Button("Process Plants", variant="primary")
|
| 145 |
-
|
| 146 |
-
|
|
|
|
| 147 |
|
| 148 |
fetch_btn.click(
|
| 149 |
fn=process_plants(plants),
|
| 150 |
#fn=lambda x: process_plants([p.strip() for p in x.split(",")]),
|
| 151 |
#inputs=plant_input,
|
| 152 |
-
outputs=json_output
|
| 153 |
)
|
| 154 |
|
| 155 |
if __name__ == "__main__":
|
|
|
|
| 9 |
from bs4 import BeautifulSoup
|
| 10 |
|
| 11 |
specialtoken=os.getenv("SPECIALTOKEN")
|
| 12 |
+
plants=['Turmeric', 'Aloe Vera', 'Neem', 'Tulsi', 'Ashwagandha', 'Ginger', 'Basil', 'Peppermint', 'Lavender', 'Eucalyptus', 'Chamomile', 'Sandalwood', 'Giloy', 'Haritaki', 'Brahmi', 'Gotu Kola', 'Holy Basil', 'Fenugreek', 'Licorice', 'Fennel', 'Cinnamon', 'Clove', 'Black Pepper', 'Cardamom', 'Neem', 'Indian Gooseberry', 'Saffron', 'Thyme', 'Valerian', 'Marigold', 'Ginseng', 'Dandelion', 'Hibiscus', 'Milk Thistle', 'Magnolia', "St. John's Wort", 'Yarrow', 'Calendula', 'Coriander', 'Senna', 'Echinacea', 'Moringa', 'Plantain', 'Amla', 'Shatavari', 'Peppermint', 'Chamomile', 'Gotu Kola', 'Ashoka', 'Arnica', 'Burdock Root', "Cat's Claw", "Devil's Claw", 'Elderberry', 'Feverfew', 'Ginkgo Biloba', 'Goldenseal', 'Hawthorn', 'Kava', 'Lemon Balm', 'Marshmallow Root', 'Nettle', 'Olive Leaf', 'Passionflower', 'Red Clover', 'Reishi Mushroom', 'Rhodiola', 'Sage', 'Saw Palmetto', 'Slippery Elm', 'Stinging Nettle', 'Witch Hazel', 'Yellow Dock', 'Ashitaba', 'Bael', 'Bacopa', 'Cumin', 'Guduchi', 'Jamun', 'Jatamansi', 'Karela', 'Gudmar', 'Schisandra', 'Baikal Skullcap', 'Mullein', 'Chrysanthemum', 'Catuaba', 'Dong Quai', 'Jiaogulan', 'Muira Puama', 'Catnip', 'Olive']
|
| 13 |
+
#plants = ["Echinacea", "Ginkgo biloba", "Turmeric"]
|
| 14 |
|
| 15 |
PROMPT_TEMPLATE = """
|
| 16 |
Extract plant information from the following content in JSON format with these keys:
|
|
|
|
| 142 |
plant_input = gr.Textbox(label="Plant Names",
|
| 143 |
placeholder="e.g., Neem, Peppermint, Aloe Vera")
|
| 144 |
fetch_btn = gr.Button("Process Plants", variant="primary")
|
| 145 |
+
|
| 146 |
+
output_area = gr.Textbox(label="AI-Processed Results", lines=10, interactive=False)
|
| 147 |
+
#json_output = gr.JSON(label="AI-Processed Results")
|
| 148 |
|
| 149 |
fetch_btn.click(
|
| 150 |
fn=process_plants(plants),
|
| 151 |
#fn=lambda x: process_plants([p.strip() for p in x.split(",")]),
|
| 152 |
#inputs=plant_input,
|
| 153 |
+
outputs=output_area #json_output
|
| 154 |
)
|
| 155 |
|
| 156 |
if __name__ == "__main__":
|