|
--- |
|
library_name: transformers |
|
license: apache-2.0 |
|
datasets: |
|
- argilla/distilabel-intel-orca-dpo-pairs |
|
language: |
|
- en |
|
pipeline_tag: text-generation |
|
--- |
|
# Model Card: Neural-phi2 |
|
|
|
![Poster Image](poster.png) |
|
|
|
## Model Details |
|
|
|
- **Model Name**: Neural-phi2 |
|
- **Model Type**: Large Language Model (LLM) |
|
- **Model Architecture**: A finetuned version of the Phi2 model from Microsoft, utilizing Direct Preference Optimization (DPO) on the `distilabel-intel-orca-dpo-pairs` dataset. |
|
- **Model Size**: Approximately 2B parameters |
|
- **Training Data**: The model was finetuned on the `distilabel-intel-orca-dpo-pairs` dataset, which consists of chat-like prompts and responses. |
|
- **Training Procedure**: The Phi2 model was finetuned using the DPO technique. The training process involved: |
|
- Loading and formatting the `distilabel-intel-orca-dpo-pairs` dataset |
|
- Defining the training configuration, including batch size, learning rate, and number of epochs |
|
- Initializing the DPO Trainer and training the model |
|
- Saving the finetuned model and tokenizer |
|
|
|
## Intended Use |
|
|
|
The Neural-phi2 model is intended to be used as a general-purpose language model for a variety of natural language processing tasks, such as text generation, summarization, and question answering. It may be particularly useful in applications where the model needs to generate coherent and contextually appropriate responses, such as in chatbots or virtual assistants. |
|
|
|
## Sample Inference Code |
|
|
|
```python |
|
from transformers import AutoModelForCausalLM, AutoTokenizer |
|
|
|
# Load the Neural-phi2 model and tokenizer |
|
model = AutoModelForCausalLM.from_pretrained("Neural-phi2") |
|
tokenizer = AutoTokenizer.from_pretrained("Neural-phi2") |
|
|
|
# Define a sample prompt |
|
messages = [ |
|
{"role": "system", "content": "You are a helpful chatbot assistant."}, |
|
{"role": "user", "content": "Hello, how are you today?"} |
|
] |
|
|
|
# Format the prompt in ChatML format |
|
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False) |
|
|
|
# Create a pipeline and generate a response |
|
pipeline = transformers.pipeline("text-generation", model=model, tokenizer=tokenizer) |
|
output = pipeline( |
|
prompt, |
|
do_sample=True, |
|
temperature=0.7, |
|
top_p=0.9, |
|
num_return_sequences=1, |
|
max_new_tokens=100, |
|
) |
|
|
|
# Print the generated response |
|
print(output[0]["generated_text"]) |
|
``` |
|
|
|
## Limitations and Biases |
|
|
|
As with any large language model, the Neural-phi2 model may exhibit biases present in its training data, such as societal biases or factual inaccuracies. Additionally, the model's performance may degrade for tasks or inputs that are significantly different from its training data. Users should carefully evaluate the model's outputs and make appropriate adjustments for their specific use cases. |
|
|
|
## Performance |
|
|
|
The performance of the Neural-phi2 model has not been extensively evaluated or benchmarked as part of this project. Users should conduct their own evaluations to assess the model's suitability for their specific tasks and use cases. |
|
|
|
## Ethical Considerations |
|
|
|
The use of large language models like Neural-phi2 raises several ethical considerations, such as the potential for generating harmful or biased content, the risk of misuse, and the importance of transparency and accountability. Users should carefully consider these ethical implications and take appropriate measures to mitigate potential harms. |
|
|
|
|