Instructions to use CaffeineAddict69/qwen7b-water-rural-practices with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CaffeineAddict69/qwen7b-water-rural-practices with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CaffeineAddict69/qwen7b-water-rural-practices") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CaffeineAddict69/qwen7b-water-rural-practices") model = AutoModelForCausalLM.from_pretrained("CaffeineAddict69/qwen7b-water-rural-practices", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CaffeineAddict69/qwen7b-water-rural-practices with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CaffeineAddict69/qwen7b-water-rural-practices" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CaffeineAddict69/qwen7b-water-rural-practices", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CaffeineAddict69/qwen7b-water-rural-practices
- SGLang
How to use CaffeineAddict69/qwen7b-water-rural-practices with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "CaffeineAddict69/qwen7b-water-rural-practices" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CaffeineAddict69/qwen7b-water-rural-practices", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "CaffeineAddict69/qwen7b-water-rural-practices" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CaffeineAddict69/qwen7b-water-rural-practices", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use CaffeineAddict69/qwen7b-water-rural-practices with Docker Model Runner:
docker model run hf.co/CaffeineAddict69/qwen7b-water-rural-practices
Qwen 2.5 7B — Rural Water Monitoring Practices Classifier
Fine-tuned version of Qwen/Qwen2.5-7B-Instruct for classifying and extracting good and bad practices in rural water monitoring research papers.
Model Description
This model analyzes text chunks from academic papers and identifies whether they describe good or bad practices for rural water monitoring systems, classifying them across 14 predefined categories (7 good + 7 bad).
The model was fine-tuned with LoRA (r=32) on a dataset of 3516 chunks labeled by Qwen 2.5 72B Instruct AWQ.
Categories
Good practices: data_acquisition_technology, data_management, operation_maintenance, sustainability, community_participation, local_adaptation, scalability
Bad practices: inappropriate_technology, non_adaptable_infrastructure, cloud_dependency, high_costs, technical_complexity, centralization, rural_inaccessibility
Output Format
The model returns structured JSON:
{
"contains_practice": true,
"practices": [
{
"type": "good",
"categories": ["data_acquisition_technology", "sustainability"],
"span": "verbatim text from input",
"explanation": "brief justification",
"confidence": 0.92
}
],
"summary": "one-sentence summary"
}
Evaluation Results
Evaluated on a held-out set of 390 chunks:
| Metric | Value |
|---|---|
| JSON parse success | 99.7% |
| Accuracy (contains_practice) | 91.0% |
| Precision | 90.2% |
| Recall | 82.8% |
| F1 | 0.864 |
| Type agreement (good/bad) | 83.8% |
| Mean categories Jaccard | 0.641 |
Training Details
| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen2.5-7B-Instruct |
| Method | LoRA (r=32, alpha=64) |
| Trainable params | 80.7M (1.05% of total) |
| Train samples | 3516 |
| Epochs | 3 |
| Batch size (effective) | 16 |
| Learning rate | 2e-4 (cosine schedule) |
| Final train loss | 1.0280 |
| Final eval loss | 1.0845 |
| Hardware | NVIDIA A100 SXM4 80GB |
| Training time | ~1 hour |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"CaffeineAddict69/qwen7b-water-rural-practices",
torch_dtype="bfloat16",
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("CaffeineAddict69/qwen7b-water-rural-practices")
system_prompt = '''You are an expert annotator for rural water monitoring research. Analyze text chunks from academic papers and identify practices (good or bad) related to rural water monitoring.
Categories of GOOD practices: data_acquisition_technology, data_management, operation_maintenance, sustainability, community_participation, local_adaptation, scalability.
Categories of BAD practices: inappropriate_technology, non_adaptable_infrastructure, cloud_dependency, high_costs, technical_complexity, centralization, rural_inaccessibility.
Return ONLY valid JSON with this schema:
{"contains_practice": true|false, "practices": [...], "summary": "..."}'''
text = "Your chunk text here..."
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": f"Analyze this chunk:\n\n---\n{text}\n---"},
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device)
outputs = model.generate(inputs, max_new_tokens=1024, do_sample=False)
response = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
print(response)
License & Citation
Apache 2.0. Inherits restrictions and rights from the base Qwen 2.5 model.
This model was developed for academic research on appropriate technologies for rural water monitoring.
- Downloads last month
- 63