Text Generation
Transformers
Safetensors
English
phi3
kto
chatml
conversational
custom_code
text-generation-inference
Instructions to use MoxoffSrL/Moxoff-Phi3Mini-KTO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MoxoffSrL/Moxoff-Phi3Mini-KTO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MoxoffSrL/Moxoff-Phi3Mini-KTO", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MoxoffSrL/Moxoff-Phi3Mini-KTO", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("MoxoffSrL/Moxoff-Phi3Mini-KTO", trust_remote_code=True, 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 MoxoffSrL/Moxoff-Phi3Mini-KTO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MoxoffSrL/Moxoff-Phi3Mini-KTO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MoxoffSrL/Moxoff-Phi3Mini-KTO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MoxoffSrL/Moxoff-Phi3Mini-KTO
- SGLang
How to use MoxoffSrL/Moxoff-Phi3Mini-KTO 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 "MoxoffSrL/Moxoff-Phi3Mini-KTO" \ --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": "MoxoffSrL/Moxoff-Phi3Mini-KTO", "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 "MoxoffSrL/Moxoff-Phi3Mini-KTO" \ --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": "MoxoffSrL/Moxoff-Phi3Mini-KTO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MoxoffSrL/Moxoff-Phi3Mini-KTO with Docker Model Runner:
docker model run hf.co/MoxoffSrL/Moxoff-Phi3Mini-KTO
Update README.md
Browse files
README.md
CHANGED
|
@@ -17,7 +17,7 @@ metrics:
|
|
| 17 |
# Model Information
|
| 18 |
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
- It's trained on [distilabel-intel-orca-kto](https://huggingface.co/datasets/argilla/distilabel-intel-orca-kto).
|
| 23 |
|
|
@@ -27,7 +27,7 @@ We evaluated the model using the same test sets as used for the [Open LLM Leader
|
|
| 27 |
|
| 28 |
| hellaswag acc_norm | arc_challenge acc_norm | m_mmlu 5-shot acc | Average |
|
| 29 |
|:----------------------| :--------------- | :-------------------- | :------- |
|
| 30 |
-
| 0.7915 | 0.5606 | 0.6939 | 0.
|
| 31 |
|
| 32 |
|
| 33 |
## Usage
|
|
@@ -43,8 +43,8 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 43 |
|
| 44 |
device = "cpu" # if you want to use the gpu make sure to have cuda toolkit installed and change this to "cuda"
|
| 45 |
|
| 46 |
-
model = AutoModelForCausalLM.from_pretrained("MoxoffSpA/
|
| 47 |
-
tokenizer = AutoTokenizer.from_pretrained("MoxoffSpA/
|
| 48 |
|
| 49 |
question = """Quanto è alta la torre di Pisa?"""
|
| 50 |
context = """
|
|
@@ -78,7 +78,7 @@ print(trimmed_output)
|
|
| 78 |
|
| 79 |
## Bias, Risks and Limitations
|
| 80 |
|
| 81 |
-
|
| 82 |
responses like ChatGPT, so the model can produce problematic outputs (especially when prompted to do so). It is also unknown what the size and composition
|
| 83 |
of the corpus was used to train the base model, however it is likely to have included a mix of Web data and technical sources
|
| 84 |
like books and code.
|
|
|
|
| 17 |
# Model Information
|
| 18 |
|
| 19 |
|
| 20 |
+
Moxoff-Phi3Mini-KTO is an updated version of [Phi-3-mini-128k-instruct](https://huggingface.co/microsoft/Phi-3-mini-128k-instruct), aligned with KTO and QLora.
|
| 21 |
|
| 22 |
- It's trained on [distilabel-intel-orca-kto](https://huggingface.co/datasets/argilla/distilabel-intel-orca-kto).
|
| 23 |
|
|
|
|
| 27 |
|
| 28 |
| hellaswag acc_norm | arc_challenge acc_norm | m_mmlu 5-shot acc | Average |
|
| 29 |
|:----------------------| :--------------- | :-------------------- | :------- |
|
| 30 |
+
| 0.7915 | 0.5606 | 0.6939 | 0.682 |
|
| 31 |
|
| 32 |
|
| 33 |
## Usage
|
|
|
|
| 43 |
|
| 44 |
device = "cpu" # if you want to use the gpu make sure to have cuda toolkit installed and change this to "cuda"
|
| 45 |
|
| 46 |
+
model = AutoModelForCausalLM.from_pretrained("MoxoffSpA/Moxoff-Phi3Mini-KTO")
|
| 47 |
+
tokenizer = AutoTokenizer.from_pretrained("MoxoffSpA/Moxoff-Phi3Mini-KTO")
|
| 48 |
|
| 49 |
question = """Quanto è alta la torre di Pisa?"""
|
| 50 |
context = """
|
|
|
|
| 78 |
|
| 79 |
## Bias, Risks and Limitations
|
| 80 |
|
| 81 |
+
Moxoff-Phi3Mini-KTO has not been aligned to human preferences for safety within the RLHF phase or deployed with in-the-loop filtering of
|
| 82 |
responses like ChatGPT, so the model can produce problematic outputs (especially when prompted to do so). It is also unknown what the size and composition
|
| 83 |
of the corpus was used to train the base model, however it is likely to have included a mix of Web data and technical sources
|
| 84 |
like books and code.
|