Update app.py
Browse files
app.py
CHANGED
|
@@ -126,6 +126,12 @@ def process_plants(plants_array: List[str]) -> str:
|
|
| 126 |
|
| 127 |
return print(results)
|
| 128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
|
| 130 |
#use it here :
|
| 131 |
#process_plants(plants)
|
|
@@ -144,7 +150,7 @@ with gr.Blocks(title="AI-Powered Medicinal Plants Database") as app:
|
|
| 144 |
#json_output = gr.JSON(label="AI-Processed Results")
|
| 145 |
|
| 146 |
fetch_btn.click(
|
| 147 |
-
fn=
|
| 148 |
#fn=lambda x: process_plants([p.strip() for p in x.split(",")]),
|
| 149 |
inputs=plant_input,
|
| 150 |
outputs=output_area #json_output
|
|
|
|
| 126 |
|
| 127 |
return print(results)
|
| 128 |
|
| 129 |
+
def split_and_search(text:str):
|
| 130 |
+
all_data=""
|
| 131 |
+
plants=text.split(",")
|
| 132 |
+
for t in plants:
|
| 133 |
+
all_data+=search_full_plant_information(t.strip())[6:-3]+"\n\n"
|
| 134 |
+
return all_data
|
| 135 |
|
| 136 |
#use it here :
|
| 137 |
#process_plants(plants)
|
|
|
|
| 150 |
#json_output = gr.JSON(label="AI-Processed Results")
|
| 151 |
|
| 152 |
fetch_btn.click(
|
| 153 |
+
fn=split_and_search,
|
| 154 |
#fn=lambda x: process_plants([p.strip() for p in x.split(",")]),
|
| 155 |
inputs=plant_input,
|
| 156 |
outputs=output_area #json_output
|