Instructions to use cakra84/Agrease-Chatbot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use cakra84/Agrease-Chatbot with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="cakra84/Agrease-Chatbot", filename="unsloth.Q4_K_M.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use cakra84/Agrease-Chatbot with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf cakra84/Agrease-Chatbot:Q4_K_M # Run inference directly in the terminal: llama-cli -hf cakra84/Agrease-Chatbot:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf cakra84/Agrease-Chatbot:Q4_K_M # Run inference directly in the terminal: llama-cli -hf cakra84/Agrease-Chatbot:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf cakra84/Agrease-Chatbot:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf cakra84/Agrease-Chatbot:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf cakra84/Agrease-Chatbot:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf cakra84/Agrease-Chatbot:Q4_K_M
Use Docker
docker model run hf.co/cakra84/Agrease-Chatbot:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use cakra84/Agrease-Chatbot with Ollama:
ollama run hf.co/cakra84/Agrease-Chatbot:Q4_K_M
- Unsloth Studio
How to use cakra84/Agrease-Chatbot with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for cakra84/Agrease-Chatbot to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for cakra84/Agrease-Chatbot to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for cakra84/Agrease-Chatbot to start chatting
- Docker Model Runner
How to use cakra84/Agrease-Chatbot with Docker Model Runner:
docker model run hf.co/cakra84/Agrease-Chatbot:Q4_K_M
- Lemonade
How to use cakra84/Agrease-Chatbot with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull cakra84/Agrease-Chatbot:Q4_K_M
Run and chat with the model
lemonade run user.Agrease-Chatbot-Q4_K_M
List all available models
lemonade list
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,85 +1,57 @@
|
|
| 1 |
license: apache-2.0
|
| 2 |
-
language:
|
| 3 |
-
|
| 4 |
-
en
|
| 5 |
tags:
|
| 6 |
|
| 7 |
text-generation
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
bangkit
|
| 12 |
-
|
| 13 |
-
agrease
|
| 14 |
-
metrics:
|
| 15 |
-
|
| 16 |
-
loss
|
| 17 |
-
base_model: mistralai/Mistral-7B-Instruct-v0.3
|
| 18 |
-
datasets:
|
| 19 |
|
| 20 |
-
|
| 21 |
-
model-index:
|
| 22 |
|
| 23 |
-
|
| 24 |
-
results:
|
| 25 |
|
| 26 |
-
|
| 27 |
-
type: text-generation
|
| 28 |
-
dataset:
|
| 29 |
-
type: custom-scraped
|
| 30 |
-
name: Agrease Application Data
|
| 31 |
-
metrics:
|
| 32 |
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
name: Fine-Tuning Loss
|
| 36 |
-
|
| 37 |
-
Fine-Tuning Mistral for the Agrease Application
|
| 38 |
-
Author: Benito Yvan Deva Putra Arung Dirgantara
|
| 39 |
-
Contact: benitodeva84@gmail.com
|
| 40 |
-
Project: Bangkit Academy 2024 - Machine Learning Path
|
| 41 |
-
|
| 42 |
-
1. Project Overview
|
| 43 |
-
This project focuses on the fine-tuning of the Mistral v3 Large Language Model (LLM) to create a specialized model for the "Agrease" application. The primary objective was to adapt the general capabilities of the Mistral LLM to understand and process domain-specific data relevant to Agrease, enhancing its performance for tasks such as recommendation and data interpretation.
|
| 44 |
-
|
| 45 |
-
This was developed as a capstone project during my participation in the Bangkit Academy 2024 Batch 2 program, under the Machine Learning learning path.
|
| 46 |
-
|
| 47 |
-
2. Methodology
|
| 48 |
-
The project followed a structured machine learning workflow, from data acquisition to model evaluation.
|
| 49 |
|
| 50 |
-
|
| 51 |
-
To build a relevant dataset for fine-tuning, web scraping techniques were employed.
|
| 52 |
|
| 53 |
-
|
|
|
|
| 54 |
|
| 55 |
-
|
| 56 |
|
| 57 |
-
|
| 58 |
-
The
|
| 59 |
|
| 60 |
-
|
| 61 |
|
| 62 |
-
|
| 63 |
|
| 64 |
-
|
| 65 |
|
| 66 |
-
|
| 67 |
-
|
| 68 |
|
| 69 |
-
|
|
|
|
| 70 |
|
| 71 |
-
|
| 72 |
|
| 73 |
-
|
|
|
|
|
|
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
| 77 |
|
| 78 |
-
|
|
|
|
| 79 |
|
| 80 |
-
|
| 81 |
|
| 82 |
-
|
|
|
|
| 83 |
|
| 84 |
-
|
| 85 |
-
|
|
|
|
| 1 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
| 2 |
tags:
|
| 3 |
|
| 4 |
text-generation
|
| 5 |
|
| 6 |
+
conversational
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
mistral
|
|
|
|
| 9 |
|
| 10 |
+
fine-tuned
|
|
|
|
| 11 |
|
| 12 |
+
chatbot
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
bangkit
|
| 15 |
+
widget:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
text: "Hello! I'm looking for recommendations on agricultural products."
|
|
|
|
| 18 |
|
| 19 |
+
Fine-Tuned Mistral Model for Agrease Application
|
| 20 |
+
This repository contains a fine-tuned version of a Mistral Large Language Model, specifically adapted for the "Agrease" application. The model was developed as part of a capstone project for Bangkit Academy 2024 Batch 2.
|
| 21 |
|
| 22 |
+
The primary goal of this project was to create a specialized conversational AI capable of assisting users within the Agrease application, likely by providing information and recommendations based on data from various marketplaces.
|
| 23 |
|
| 24 |
+
Model Description
|
| 25 |
+
Base Model: The model is a fine-tuned version of a Mistral v3 Large Language Model.
|
| 26 |
|
| 27 |
+
Fine-tuning Task: The model was fine-tuned for conversational question-answering and recommendations.
|
| 28 |
|
| 29 |
+
Training Data: The training data was collected by scraping various online marketplaces using Python libraries such as BeautifulSoup and Scrapy.
|
| 30 |
|
| 31 |
+
Performance: The fine-tuning process achieved a final training loss of 11%.
|
| 32 |
|
| 33 |
+
Intended Use
|
| 34 |
+
This model is intended to be used as a chatbot or a conversational agent within a larger application. It can answer user queries, provide product recommendations, and engage in domain-specific conversations related to the "Agrease" application's scope.
|
| 35 |
|
| 36 |
+
How to Use
|
| 37 |
+
You can use this model with the transformers library for text generation.
|
| 38 |
|
| 39 |
+
from transformers import pipeline
|
| 40 |
|
| 41 |
+
# Load the text generation pipeline from the Hugging Face Hub
|
| 42 |
+
# Replace "your-username/model-name" with the actual model path
|
| 43 |
+
generator = pipeline('text-generation', model='your-username/model-name')
|
| 44 |
|
| 45 |
+
# Example prompt
|
| 46 |
+
prompt = "What are the best fertilizers for rice paddies in a tropical climate?"
|
| 47 |
|
| 48 |
+
# Generate a response
|
| 49 |
+
response = generator(prompt, max_length=150, num_return_sequences=1)
|
| 50 |
|
| 51 |
+
print(response[0]['generated_text'])
|
| 52 |
|
| 53 |
+
Training Data
|
| 54 |
+
The dataset used for fine-tuning was created by scraping publicly available data from various e-commerce and marketplace websites. The scraping was performed using custom Python scripts with BeautifulSoup and Scrapy. The collected data was then processed and formatted into a conversational format suitable for training a large language model.
|
| 55 |
|
| 56 |
+
Training Procedure
|
| 57 |
+
The fine-tuning was performed using the PyTorch framework on the collected dataset. The training focused on minimizing the cross-entropy loss to improve the model's ability to generate relevant and coherent responses in a conversational context. The final model achieved a training loss of 0.11
|