AdityaAdaki commited on
Commit
c23685e
·
0 Parent(s):
Files changed (4) hide show
  1. .gitattributes +1 -0
  2. Modelfile +59 -0
  3. readme +94 -0
  4. unsloth.Q4_K_M.gguf +3 -0
.gitattributes ADDED
@@ -0,0 +1 @@
 
 
1
+ *.gguf filter=lfs diff=lfs merge=lfs -text
Modelfile ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ./unsloth.F16.gguf
2
+
3
+ TEMPLATE """
4
+ {{ if .Messages }}
5
+ {{- if or .System .Tools }}<|start_header_id|>system<|end_header_id|>
6
+ {{- if .System }}
7
+
8
+ {{ .System }}
9
+ {{- end }}
10
+ {{- if .Tools }}
11
+
12
+ You are a helpful assistant specialized in providing information about plant diseases to Indian farmers. When you receive a tool call response, use the output to format an answer to the original user question.
13
+ {{- end }}
14
+ {{- end }}<|eot_id|>
15
+ {{- range $i, $_ := .Messages }}
16
+ {{- $last := eq (len (slice $.Messages $i)) 1 }}
17
+ {{- if eq .Role "user" }}<|start_header_id|>user<|end_header_id|>
18
+ {{- if and $.Tools $last }}
19
+
20
+ Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt.
21
+
22
+ Respond in the format {"name": "function_name", "parameters": {"argument_name": "argument_value"}}. Do not use variables.
23
+
24
+ {{ $.Tools }}
25
+ {{- end }}
26
+
27
+ {{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
28
+
29
+ {{ end }}
30
+ {{- else if eq .Role "assistant" }}<|start_header_id|>assistant<|end_header_id|>
31
+ {{- if .ToolCalls }}
32
+
33
+ {{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}{{ end }}
34
+ {{- else }}
35
+
36
+ {{ .Content }}{{ if not $last }}<|eot_id|>{{ end }}
37
+ {{- end }}
38
+ {{- else if eq .Role "tool" }}<|start_header_id|>ipython<|end_header_id|>
39
+
40
+ {{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
41
+
42
+ {{ end }}
43
+ {{- end }}
44
+ {{- end }}
45
+ {{- else }}
46
+ {{- if .System }}<|start_header_id|>system<|end_header_id|>
47
+
48
+ {{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>
49
+
50
+ {{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>
51
+
52
+ {{ end }}{{ .Response }}{{ if .Response }}<|eot_id|>{{ end }}
53
+ """
54
+ PARAMETER stop "<|start_header_id|>"
55
+ PARAMETER stop "<|end_header_id|>"
56
+ PARAMETER stop "<|eot_id|>"
57
+ PARAMETER stop "<|eom_id|>"
58
+ PARAMETER temperature 1.5
59
+ PARAMETER min_p 0.1
readme ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AgriAssist-LLM: Plant Disease Information Assistant
2
+
3
+ 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.
4
+
5
+ ## Features
6
+
7
+ - **Tailored Guidance:** Provides comprehensive details on various plant diseases affecting Indian crops.
8
+ - **Practical Recommendations:** Offers clear instructions on treatment and prevention, helping farmers manage crop health.
9
+ - **User-Friendly:** Utilizes the Alpaca Instruct Format to generate responses in simple, accessible language.
10
+ - **Versatile Applications:** Suitable for use by farmers, agronomists, and agricultural extension workers.
11
+
12
+ ## Model Details
13
+
14
+ - **Base Model:** Llama3.2:1B
15
+ - **Fine-Tuning Dataset:** Custom dataset of 200 samples focusing on plant diseases in Indian agriculture.
16
+ - **Intended Use:** Assisting in the identification, explanation, and management of plant diseases.
17
+
18
+ ## Installation
19
+
20
+ To use AgriAssist-LLM, install the required libraries:
21
+
22
+ ```bash
23
+ pip install transformers torch
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ ### Using Hugging Face Transformers
29
+
30
+ Here’s an example of how to use AgriAssist-LLM with the Hugging Face Transformers library:
31
+
32
+ ```python
33
+ from transformers import AutoTokenizer, AutoModelForCausalLM
34
+
35
+ # Load the tokenizer and model from the Hugging Face Hub
36
+ tokenizer = AutoTokenizer.from_pretrained("your-username/AgriAssist-LLM")
37
+ model = AutoModelForCausalLM.from_pretrained("your-username/AgriAssist-LLM")
38
+
39
+ # Define a prompt
40
+ prompt = "Explain Red Rot in sugarcane in simple terms for Indian farmers."
41
+
42
+ # Tokenize and generate a response
43
+ inputs = tokenizer(prompt, return_tensors="pt")
44
+ outputs = model.generate(**inputs, max_new_tokens=256)
45
+
46
+ # Decode and print the generated response
47
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
48
+ ```
49
+
50
+ *Note:* Replace `your-username/AgriAssist-LLM` with the actual path of your repository.
51
+
52
+ ### Using Ollama
53
+
54
+ You can also use AgriAssist-LLM with [Ollama](https://ollama.ai), a simple way to run large language models locally.
55
+
56
+ 1. Install Ollama if you haven't already:
57
+
58
+ ```bash
59
+ curl -fsSL https://ollama.ai/install.sh | sh
60
+ ```
61
+
62
+ 2. Pull the model from Hugging Face and convert it to an Ollama-compatible format.
63
+
64
+ 3. Run the model using Ollama:
65
+
66
+ ```bash
67
+ ollama run AgriAssist-LLM "Explain Red Rot in sugarcane in simple terms for Indian farmers."
68
+ ```
69
+
70
+ This will generate a response based on the model’s fine-tuned dataset.
71
+
72
+ ## Fine-Tuning and Training
73
+
74
+ 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:
75
+
76
+ - **Sugarcane:** Bacterial Blight, Healthy, Red Rot
77
+ - **Maize:** Blight, Common Rust, Gray Leaf Spot, Healthy
78
+ - **Cotton:** Bacterial Blight, Curl Virus, Fusarium Wilt, Healthy
79
+ - **Rice:** Bacterial Blight, Blast, Brownspot, Tungro
80
+ - **Wheat:** Healthy, Septoria, Strip Rust
81
+
82
+ ## Dataset
83
+
84
+ The fine-tuning dataset consists of carefully curated samples that provide comprehensive, accurate information designed to help users manage crop diseases effectively.
85
+
86
+
87
+ ## Contact
88
+
89
+ For questions or suggestions, please open an issue in the repository or contact the authors directly.
90
+
91
+ ---
92
+
93
+ Happy farming with AgriAssist-LLM!
94
+
unsloth.Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fc600b570a00d3eacc8a51e1b6e4ec3737285e5ad116b548cd095cb9e3d8e09
3
+ size 807694784