Instructions to use willieseun/Enron-Mixral-8x7b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use willieseun/Enron-Mixral-8x7b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="willieseun/Enron-Mixral-8x7b-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("willieseun/Enron-Mixral-8x7b-instruct") model = AutoModelForCausalLM.from_pretrained("willieseun/Enron-Mixral-8x7b-instruct") 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 willieseun/Enron-Mixral-8x7b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "willieseun/Enron-Mixral-8x7b-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "willieseun/Enron-Mixral-8x7b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/willieseun/Enron-Mixral-8x7b-instruct
- SGLang
How to use willieseun/Enron-Mixral-8x7b-instruct 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 "willieseun/Enron-Mixral-8x7b-instruct" \ --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": "willieseun/Enron-Mixral-8x7b-instruct", "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 "willieseun/Enron-Mixral-8x7b-instruct" \ --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": "willieseun/Enron-Mixral-8x7b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use willieseun/Enron-Mixral-8x7b-instruct with Docker Model Runner:
docker model run hf.co/willieseun/Enron-Mixral-8x7b-instruct
Model Details
Model Description
The willieseun/Enron-Mixral-8x7b-instruct model is a large-scale language model based on the Mixtral architecture, fine-tuned specifically for email generation using the Enron dataset. This model is designed to generate coherent and contextually appropriate text, particularly suited for tasks related to email composition.
- Developed by: WILLIESEUN
- Model type: Transformer-based Language Model
- Language(s) (NLP): English
- License: Apache 2.0
Model Sources
- Repository: Hugging Face Model Hub
Uses
Direct Use
The model can be used directly for email generation tasks. Users can input prompts or partial content, and the model will generate corresponding text.
Downstream Use
This model is suitable for downstream tasks requiring email composition, such as email summarization, response generation, or personalized email content generation.
Bias, Risks, and Limitations
The model's performance may vary depending on the quality and representativeness of the training data (Enron dataset). It may exhibit biases present in the training data, and caution should be exercised when using generated text in sensitive or critical applications.
Recommendations
Users should review and post-process the generated text to ensure appropriateness and accuracy, particularly in professional or formal communication settings.
How to Get Started with the Model
To use the model, you can leverage the Hugging Face Transformers library. Below is an example code snippet for generating emails:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "willieseun/Enron-Mixral-8x7b-instruct"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Example prompt
prompt_text = "Compose an email from Claudio Ribeiro to Vince J Kaminski regarding the possibility of sponsoring a Financial Engineering Pro-Seminar at MIT. The email should mention that Enron may have sponsored a similar seminar in the past (related to Real Options) and inquire if the Research department or the Weather Desk (interested in a Weather Trading problem) would be interested in co-sponsoring."
pipe = pipeline("text-generation", tokenizer=tokenizer, model=model, return_full_text=False, max_length=190)
print(pipe(str(prompt_str)))
Training Details
Training Data
The model was fine-tuned on the Enron email dataset, which contains real-world emails from employees at the Enron Corporation.
Training Procedure
The training utilized the PeftModelForCausalLM architecture and was fine-tuned using a Causal-LM approach, optimizing for email generation tasks.
Training Hyperparameters
- Training regime: CausalLM fine-tuning
- Batch size: 1
- Learning rate: 2e-4
- Epochs: 5
Evaluation
Testing Data, Factors & Metrics
Testing Data
The model was evaluated on a held-out subset of the Enron dataset.
Metrics
Only the evaluation loss was used.
Results
The model demonstrates coherent and contextually relevant email generation based on the evaluation metrics.
Environmental Impact
The environmental impact of model training and inference can vary based on the hardware and compute infrastructure used.
Citation
BibTeX:
@article{willieseun_enron_mixtral_instruct,
title={willieseun/Enron-Mixral-8x7b-instruct: Fine-tuned Email Generation Model},
author={WILLIESEUN},
journal={Hugging Face Model Hub},
year={2024},
howpublished={url{https://huggingface.co/willieseun/Enron-Mixral-8x7b-instruct}}
}
APA:
MistralAI. (2024). willieseun/Enron-Mixral-8x7b-instruct: Fine-tuned Email Generation Model. Hugging Face Model Hub. https://huggingface.co/willieseun/Enron-Mixral-8x7b-instruct
This model card provides an overview of the willieseun/Enron-Mixral-8x7b-instruct model, its use case, training details, and environmental considerations for users interested in utilizing this model for email generation tasks. For further information, please refer to the associated Hugging Face Model Hub repository.
- Downloads last month
- 7