Text Generation
Transformers
Safetensors
mistral
trl
sft
Generated from Trainer
text-generation-inference
Instructions to use fionazhang/mistral-environment-all with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fionazhang/mistral-environment-all with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fionazhang/mistral-environment-all")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("fionazhang/mistral-environment-all") model = AutoModelForCausalLM.from_pretrained("fionazhang/mistral-environment-all") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use fionazhang/mistral-environment-all with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fionazhang/mistral-environment-all" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fionazhang/mistral-environment-all", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/fionazhang/mistral-environment-all
- SGLang
How to use fionazhang/mistral-environment-all 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 "fionazhang/mistral-environment-all" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fionazhang/mistral-environment-all", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "fionazhang/mistral-environment-all" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fionazhang/mistral-environment-all", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use fionazhang/mistral-environment-all with Docker Model Runner:
docker model run hf.co/fionazhang/mistral-environment-all
mistral-environment-all
Model Description
The model is a fine-tuned (quantized) Mistral7b model on a self-organised dataset about environmental knowledge. This model is currently still under development.
- Developed by: Fiona Zhang
- Funded: CSIRO, Pawsey Supercomputing Research Centre
- Finetuned from model: Mistral7b
Uses
This repository includes the weights learned during the training process. It should be loaded witht the pre-trained Mistral 7b and tokenizer.
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
# Load the tokenizer, adjust configuration if needed
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Text generation
def generate_text_sequences(pipe, prompt):
sequences = pipe(
f"prompt",
do_sample=True,
max_new_tokens=100,
temperature=0.8,
top_k=50,
top_p=0.95,
num_return_sequences=1,
)
return sequences[0]['generated_text']
# Now you can use the model for inference
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.bfloat16,
device_map="auto",
pad_token_id=2
)
print(generate_text_sequences(pipe, "your prompt"))
Training Data
The fine-tuning data are parsed from these public Wikipedia websites:
- Environmental Issues
- Natural Environment
- Biophysical Environment
- Ecology
- Environment (Systems)
- Built Environment
- Climate Change
- Human Impact on the Environment
- Environment of Australia
- Environmental Protection
- Environmental Issues in Australia
The text corpus are preprocessed for better format.
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.0002
- train_batch_size: 32
- eval_batch_size: 8
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.03
- num_epochs: 1
Training results
Framework versions
- Transformers 4.36.2
- Pytorch 2.1.0a0+git7bcf7da
- Datasets 2.16.1
- Tokenizers 0.15.0
Environmental Impact
- Hardware Type: Setonix (Pawsey Supercomputing Research Centre)
- Hours used: <1
- Cloud Provider: Google Cloud
- Compute Region: [More Information Needed]
- Carbon Emitted: [More Information Needed]
- Downloads last month
- 3
Model tree for fionazhang/mistral-environment-all
Base model
mistralai/Mistral-7B-v0.1