Text Generation
Transformers
Safetensors
phi3
code
conversational
custom_code
text-generation-inference
Instructions to use moelanoby/phi-3-M3-coder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use moelanoby/phi-3-M3-coder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="moelanoby/phi-3-M3-coder", 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("moelanoby/phi-3-M3-coder", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("moelanoby/phi-3-M3-coder", 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 moelanoby/phi-3-M3-coder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "moelanoby/phi-3-M3-coder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "moelanoby/phi-3-M3-coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/moelanoby/phi-3-M3-coder
- SGLang
How to use moelanoby/phi-3-M3-coder 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 "moelanoby/phi-3-M3-coder" \ --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": "moelanoby/phi-3-M3-coder", "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 "moelanoby/phi-3-M3-coder" \ --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": "moelanoby/phi-3-M3-coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use moelanoby/phi-3-M3-coder with Docker Model Runner:
docker model run hf.co/moelanoby/phi-3-M3-coder
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
|
| 2 |
---
|
| 3 |
language:
|
| 4 |
- ar
|
|
@@ -14,7 +13,6 @@ base_model:
|
|
| 14 |
library_name: transformers
|
| 15 |
tags:
|
| 16 |
- code
|
| 17 |
-
- open-source
|
| 18 |
---
|
| 19 |
# M3-V2: An Open Source Model for State-of-the-Art Code Generation
|
| 20 |
|
|
@@ -60,7 +58,7 @@ This model is licensed under the **Apache 2.0 License**. You are free to use, mo
|
|
| 60 |
|
| 61 |
## Ethical Considerations
|
| 62 |
|
| 63 |
-
While this model is open source, users are encouraged to use it responsibly. Finetuning the model to generate harmful, illegal, or unethical content is strongly discouraged.
|
| 64 |
|
| 65 |
---
|
| 66 |
|
|
@@ -125,4 +123,4 @@ except AttributeError:
|
|
| 125 |
|
| 126 |
- The base of this model utilizes the **Phi-3** architecture developed by Microsoft.
|
| 127 |
- The benchmark results were obtained using the **HumanEval** dataset from OpenAI.
|
| 128 |
-
-
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
language:
|
| 3 |
- ar
|
|
|
|
| 13 |
library_name: transformers
|
| 14 |
tags:
|
| 15 |
- code
|
|
|
|
| 16 |
---
|
| 17 |
# M3-V2: An Open Source Model for State-of-the-Art Code Generation
|
| 18 |
|
|
|
|
| 58 |
|
| 59 |
## Ethical Considerations
|
| 60 |
|
| 61 |
+
While this model is open source, users are encouraged to use it responsibly. Finetuning the model to generate harmful, illegal, or unethical content is strongly discouraged. I advocate for the use of this technology to build positive and safe applications.
|
| 62 |
|
| 63 |
---
|
| 64 |
|
|
|
|
| 123 |
|
| 124 |
- The base of this model utilizes the **Phi-3** architecture developed by Microsoft.
|
| 125 |
- The benchmark results were obtained using the **HumanEval** dataset from OpenAI.
|
| 126 |
+
- I thank the open-source community for their continuous contributions to AI research.
|