Text Generation
Transformers
PEFT
llama
disaster-management
emergency-response
humanitarian-ai
multilingual
fine-tuned
qlora
lora
llama3
conversational
4-bit precision
bitsandbytes
Instructions to use drdeveloper88/WorldDisasterLM-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use drdeveloper88/WorldDisasterLM-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="drdeveloper88/WorldDisasterLM-8B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("drdeveloper88/WorldDisasterLM-8B") model = AutoModelForCausalLM.from_pretrained("drdeveloper88/WorldDisasterLM-8B") 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]:])) - PEFT
How to use drdeveloper88/WorldDisasterLM-8B with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use drdeveloper88/WorldDisasterLM-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "drdeveloper88/WorldDisasterLM-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "drdeveloper88/WorldDisasterLM-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/drdeveloper88/WorldDisasterLM-8B
- SGLang
How to use drdeveloper88/WorldDisasterLM-8B 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 "drdeveloper88/WorldDisasterLM-8B" \ --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": "drdeveloper88/WorldDisasterLM-8B", "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 "drdeveloper88/WorldDisasterLM-8B" \ --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": "drdeveloper88/WorldDisasterLM-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use drdeveloper88/WorldDisasterLM-8B with Docker Model Runner:
docker model run hf.co/drdeveloper88/WorldDisasterLM-8B
File size: 3,411 Bytes
495526b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 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 | """dataset_builder.py — standalone entry-point.
Collects data from all configured online sources and writes the final
instruction-following JSONL dataset ready for training.
For full control over which sources and limits to use, prefer:
python scripts/collect_data.py --sources reliefweb usgs gdacs --max-per-source 5000
"""
from __future__ import annotations
import logging
from pathlib import Path
logging.basicConfig(level=logging.INFO, format="%(asctime)s | %(levelname)s | %(message)s")
logger = logging.getLogger(__name__)
DEFAULT_LIMITS: dict[str, int] = {
"reliefweb": 5000,
"usgs": 20000,
"gdacs": 2000,
"noaa": 5000,
"openfema": 20000,
"who": 1000,
}
def main() -> None:
from worlddisasterlm.data.etl import DisasterETL
from worlddisasterlm.data.qa_generator import generate_qa_pairs
from worlddisasterlm.data.scenario_builder import build_all_scenarios
from worlddisasterlm.data.processors import save_instruction_dataset
# Try live collection; fall back to stub if network is unavailable
all_records = []
for source, limit in DEFAULT_LIMITS.items():
try:
if source == "reliefweb":
from worlddisasterlm.data.collectors.reliefweb import collect_reliefweb
all_records.extend(collect_reliefweb(max_records=limit))
elif source == "usgs":
from worlddisasterlm.data.collectors.usgs import collect_usgs
all_records.extend(collect_usgs(max_records=limit))
elif source == "gdacs":
from worlddisasterlm.data.collectors.gdacs import collect_gdacs
all_records.extend(collect_gdacs(max_records=limit))
elif source == "noaa":
from worlddisasterlm.data.collectors.noaa import collect_noaa
all_records.extend(collect_noaa(max_records=limit))
elif source == "openfema":
from worlddisasterlm.data.collectors.openfema import collect_openfema
all_records.extend(collect_openfema(max_records=limit))
elif source == "who":
from worlddisasterlm.data.collectors.who_rss import collect_who
all_records.extend(collect_who(max_records=limit))
logger.info("%-12s collected %d total records so far", source, len(all_records))
except Exception as exc:
logger.warning("Source %s failed (%s). Continuing with remaining sources.", source, exc)
if not all_records:
logger.warning("No online records collected. Using stub data for offline testing.")
from worlddisasterlm.data.etl import DisasterETL
etl = DisasterETL()
all_records = etl.normalize(etl.deduplicate(etl.collect_records()))
else:
from worlddisasterlm.data.etl import DisasterETL
etl = DisasterETL()
all_records = etl.deduplicate(all_records)
all_records = etl.normalize(all_records)
logger.info("Total normalized records: %d", len(all_records))
qa_samples = generate_qa_pairs(all_records)
qa_samples.extend(build_all_scenarios())
logger.info("Total instruction samples: %d", len(qa_samples))
output_path = Path("data/processed/instruction_dataset.jsonl")
save_instruction_dataset(qa_samples, str(output_path))
logger.info("Dataset saved: %s", output_path)
if __name__ == "__main__":
main()
|