AdityaAdaki commited on
Commit
9a69027
·
1 Parent(s): 02db1f3

Set up GitHub Actions to sync with HF

Browse files
Files changed (2) hide show
  1. .github/workflows/sync_to_hf.yml +23 -0
  2. README_hf.md +147 -0
.github/workflows/sync_to_hf.yml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Sync to Hugging Face Hub
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ sync:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v3
13
+ with:
14
+ fetch-depth: 0
15
+ lfs: true
16
+ - name: Restore Hugging Face README
17
+ run: |
18
+ cp README_hf.md README.md
19
+ - name: Push to Hugging Face
20
+ env:
21
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
22
+ run: |
23
+ git push --force https://sikeaditya:[email protected]/sikeaditya/AgriAssist_LLM main
README_hf.md ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "AgriAssist-LLM: Plant Disease Information Assistant"
3
+ description: "AgriAssist-LLM is a fine-tuned large language model based on Llama3.2:1B, designed to assist Indian farmers with plant disease identification and management."
4
+ version: "1.0"
5
+ author: "Sike Aditya"
6
+ repository: "https://huggingface.co/sikeaditya/agri_assist_llm"
7
+ tags:
8
+ - Agriculture
9
+ - Plant Disease
10
+ - LLM
11
+ - AI
12
+ - India
13
+ model:
14
+ base: "meta/Llama3.2:1B"
15
+ fine_tuning_dataset: "1000 samples focusing on plant diseases in Indian agriculture"
16
+ format: "Alpaca Instruct Format"
17
+ usage:
18
+ - "Farmers"
19
+ - "Agronomists"
20
+ - "Agricultural extension workers"
21
+ installation:
22
+ ollama: "curl -fsSL https://ollama.ai/install.sh | sh"
23
+ usage_examples:
24
+ - command: "ollama run AgriAssist-LLM 'Explain Red Rot in sugarcane in simple terms for Indian farmers.'"
25
+ description: "Provides an easy-to-understand explanation of Red Rot disease in sugarcane."
26
+ dataset:
27
+ crops:
28
+ Sugarcane:
29
+ - "Bacterial Blight"
30
+ - "Healthy"
31
+ - "Red Rot"
32
+ Maize:
33
+ - "Blight"
34
+ - "Common Rust"
35
+ - "Gray Leaf Spot"
36
+ - "Healthy"
37
+ Cotton:
38
+ - "Bacterial Blight"
39
+ - "Curl Virus"
40
+ - "Fusarium Wilt"
41
+ - "Healthy"
42
+ Rice:
43
+ - "Bacterial Blight"
44
+ - "Blast"
45
+ - "Brownspot"
46
+ - "Tungro"
47
+ Wheat:
48
+ - "Healthy"
49
+ - "Septoria"
50
+ - "Strip Rust"
51
+ contact:
52
+ email: "[email protected]"
53
+ issues: "https://github.com/sikeaditya/agri_assist_llm/issues"
54
+ ---
55
+ # AgriAssist-LLM: Plant Disease Information Assistant
56
+
57
+ AgriAssist-LLM is a fine-tuned large language model based on Llama3.2:1B, specifically designed to provide detailed, actionable information about plant diseases to Indian farmers. It offers clear, concise, and locally relevant guidance on disease identification, symptoms, causes, severity, and treatment measures across major crops such as Sugarcane, Maize, Cotton, Rice, and Wheat.
58
+
59
+ ## Features
60
+
61
+ - **Tailored Guidance:** Provides comprehensive details on various plant diseases affecting Indian crops.
62
+ - **Practical Recommendations:** Offers clear instructions on treatment and prevention, helping farmers manage crop health.
63
+ - **User-Friendly:** Utilizes the Alpaca Instruct Format to generate responses in simple, accessible language.
64
+ - **Versatile Applications:** Suitable for use by farmers, agronomists, and agricultural extension workers.
65
+
66
+ ## Model Details
67
+
68
+ - **Base Model:** Llama3.2:1B
69
+ - **Fine-Tuning Dataset:** Custom dataset of 200 samples focusing on plant diseases in Indian agriculture.
70
+ - **Intended Use:** Assisting in the identification, explanation, and management of plant diseases.
71
+
72
+ ## Installation
73
+
74
+ To use AgriAssist-LLM, install the required libraries:
75
+
76
+ ```bash
77
+ pip install transformers torch
78
+ ```
79
+
80
+ ## Usage
81
+
82
+ ### Using Hugging Face Transformers
83
+
84
+ Here’s an example of how to use AgriAssist-LLM with the Hugging Face Transformers library:
85
+
86
+ ```python
87
+ from transformers import AutoTokenizer, AutoModelForCausalLM
88
+ # Load the tokenizer and model from the Hugging Face Hub
89
+ tokenizer = AutoTokenizer.from_pretrained("your-username/AgriAssist-LLM")
90
+ model = AutoModelForCausalLM.from_pretrained("your-username/AgriAssist-LLM")
91
+ # Define a prompt
92
+ prompt = "Explain Red Rot in sugarcane in simple terms for Indian farmers."
93
+ # Tokenize and generate a response
94
+ inputs = tokenizer(prompt, return_tensors="pt")
95
+ outputs = model.generate(**inputs, max_new_tokens=256)
96
+ # Decode and print the generated response
97
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
98
+ ```
99
+
100
+ *Note:* Replace `your-username/AgriAssist-LLM` with the actual path of your repository.
101
+
102
+ ### Using Ollama
103
+
104
+ You can also use AgriAssist-LLM with [Ollama](https://ollama.ai), a simple way to run large language models locally.
105
+
106
+ 1. Install Ollama if you haven't already:
107
+
108
+ ```bash
109
+ curl -fsSL https://ollama.ai/install.sh | sh
110
+ ```
111
+
112
+ 2. Pull the model from Hugging Face and convert it to an Ollama-compatible format.
113
+ ```bash
114
+ ollama run hf.co/sikeaditya/agri_assist_llm
115
+ ```
116
+
117
+ 3. Run the model using Ollama:
118
+
119
+ ```bash
120
+ ollama run AgriAssist-LLM "Explain Red Rot in sugarcane in simple terms for Indian farmers."
121
+ ```
122
+
123
+ This will generate a response based on the model’s fine-tuned dataset.
124
+
125
+ ## Fine-Tuning and Training
126
+
127
+ AgriAssist-LLM was fine-tuned using a custom dataset created in the Alpaca Instruct Format. The dataset covers detailed plant disease information tailored to the Indian context and includes samples for:
128
+
129
+ - **Sugarcane:** Bacterial Blight, Healthy, Red Rot
130
+ - **Maize:** Blight, Common Rust, Gray Leaf Spot, Healthy
131
+ - **Cotton:** Bacterial Blight, Curl Virus, Fusarium Wilt, Healthy
132
+ - **Rice:** Bacterial Blight, Blast, Brownspot, Tungro
133
+ - **Wheat:** Healthy, Septoria, Strip Rust
134
+
135
+ ## Dataset
136
+
137
+ The fine-tuning dataset consists of carefully curated samples that provide comprehensive, accurate information designed to help users manage crop diseases effectively.
138
+
139
+
140
+ ## Contact
141
+
142
+ For questions or suggestions, please open an issue in the repository or contact the authors directly.
143
+
144
+ ---
145
+
146
+ Happy farming with AgriAssist-LLM!
147
+