Spaces:
Sleeping
Sleeping
Upload README.md
Browse files
README.md
CHANGED
@@ -1,13 +1,83 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 🌿 AI Plant Guide - English & Arabic
|
2 |
+
|
3 |
+
## Overview
|
4 |
+
|
5 |
+
AI Plant Guide is a user-friendly Gradio-based application that provides detailed plant information in both English and Arabic. By entering a plant name and selecting a language, users can access insights on scientific names, growing conditions, common uses, and care tips.
|
6 |
+
|
7 |
+
## Project Objectives
|
8 |
+
- Provide an AI-powered plant guide with bilingual support.
|
9 |
+
- Ensure user-friendly interaction through a web-based interface.
|
10 |
+
- Leverage state-of-the-art NLP models for accurate and informative responses.
|
11 |
+
- Offer quick and efficient responses using GPU acceleration.
|
12 |
+
|
13 |
+
## Implemented Pipelines
|
14 |
+
1. **User Input Handling**:
|
15 |
+
- The user enters a plant name and selects a language.
|
16 |
+
2. **Model Selection**:
|
17 |
+
- Based on the chosen language, the appropriate transformer model is loaded:
|
18 |
+
- **Microsoft Phi-3-mini-4k-instruct** for English
|
19 |
+
- **ALLaM-7B-Instruct-preview** for Arabic
|
20 |
+
3. **Text Generation Pipeline**:
|
21 |
+
- The selected model generates plant details, including:
|
22 |
+
- Scientific name
|
23 |
+
- Growing conditions
|
24 |
+
- Common uses
|
25 |
+
- Care tips
|
26 |
+
4. **Output Display**:
|
27 |
+
- The generated information is displayed in a user-friendly interface.
|
28 |
+
|
29 |
+
## Instructions for Using the Interface
|
30 |
+
1. Open the **Gradio UI** in your browser.
|
31 |
+
2. Select a language (**English/Arabic**).
|
32 |
+
3. Enter a plant name (e.g., **Lavender**, **Aloe Vera**).
|
33 |
+
4. Click **"🔍 Get Plant Info"** to generate information.
|
34 |
+
5. View the plant details in the output box.
|
35 |
+
|
36 |
+
## Justification for Model and Pipeline Choices
|
37 |
+
- **Hugging Face Transformers**: Offers pre-trained state-of-the-art language models optimized for text generation.
|
38 |
+
- **Gradio**: Provides an easy-to-use web interface without the need for extensive frontend development.
|
39 |
+
- **PyTorch**: Ensures efficient model inference and flexibility for future enhancements.
|
40 |
+
- **GPU Acceleration**: Speeds up response times, improving user experience.
|
41 |
+
- **Pipeline-Based Design**: Ensures modularity and scalability for future improvements.
|
42 |
+
|
43 |
+
## Bilingual Implementation
|
44 |
+
- The project supports **English and Arabic** via two specialized transformer models.
|
45 |
+
- The UI allows users to choose their preferred language.
|
46 |
+
- The prompt structure is adapted for each language to ensure high-quality responses.
|
47 |
+
|
48 |
+
## Technologies Used
|
49 |
+
- **Gradio** for UI development
|
50 |
+
- **Transformers (Hugging Face)** for text generation
|
51 |
+
- **PyTorch** for model inference
|
52 |
+
- **Microsoft Phi-3-mini-4k-instruct** (English) and **ALLaM-7B-Instruct-preview** (Arabic) models
|
53 |
+
- **Spaces GPU Acceleration**
|
54 |
+
|
55 |
+
## Installation
|
56 |
+
|
57 |
+
### Prerequisites
|
58 |
+
Ensure you have Python installed (>=3.8) and required dependencies.
|
59 |
+
|
60 |
+
### Steps
|
61 |
+
|
62 |
+
1. **Clone the repository**:
|
63 |
+
```bash
|
64 |
+
git clone https://huggingface.co/spaces/NoufSaleh46/PlantInfo1
|
65 |
+
cd PlantInfo1
|
66 |
+
```
|
67 |
+
2. **Create a virtual environment (optional but recommended)**:
|
68 |
+
```bash
|
69 |
+
python -m venv venv
|
70 |
+
source venv/bin/activate # On Windows use `venv\Scripts\activate`
|
71 |
+
```
|
72 |
+
3. **Install dependencies**:
|
73 |
+
```bash
|
74 |
+
pip install -r requirements.txt
|
75 |
+
```
|
76 |
+
4. **Run the application**:
|
77 |
+
```bash
|
78 |
+
python app.py
|
79 |
+
```
|
80 |
+
|
81 |
+
## Deployment
|
82 |
+
This project is deployed on **Hugging Face Spaces**. You can access it directly [here](https://huggingface.co/spaces/NoufSaleh46/PlantInfo1).
|
83 |
+
|