Sponsored by
Vmake Labs Video Enhancer
-Vmake Labs Video Enhancer uses AI to improve video quality, restore details, reduce blur, and upscale videos to 8K.
Note: quants are created using latest version of llama.cpp so they should work correctly.
From original readme
How to Use
Phi-3-Medium-128k-Instruct has been integrated in the development version (4.40.2) of
transformers
. Until the official version is released through
pip
, ensure that you are doing one of the following:
When loading the model, ensure that
trust_remote_code=True
is passed as an argument of the
from_pretrained()
function.
Update your local
transformers
to the development version:
pip uninstall -y transformers && pip install git+https://github.com/huggingface/transformers
. The previous command is an alternative to cloning and installing from the source.
The current
transformers
version can be verified with:
pip list | grep transformers
.
Phi-3-Medium-128k-Instruct supports a vocabulary size of up to
32064
tokens. The
tokenizer files
already provide placeholder tokens that can be used for downstream fine-tuning, but they can also be extended up to the model's vocabulary size.
Chat Format
Given the nature of the training data, the Phi-3-Medium-128k-Instruct model is best suited for prompts using the chat format as follows.
You can provide the prompt as a question with a generic template as follow:
<|user|>\nQuestion <|end|>\n<|assistant|>
For example:
<|user|>
How to explain Internet for a medieval knight?<|end|>
<|assistant|>
where the model generates the text after
<|assistant|>
. In case of few-shots prompt, the prompt can be formatted as the following:
<|user|>
I am going to Paris, what should I see?<|end|>
<|assistant|>
Paris, the capital of France, is known for its stunning architecture, art museums, historical landmarks, and romantic atmosphere. Here are some of the top attractions to see in Paris:\n\n1. The Eiffel Tower: The iconic Eiffel Tower is one of the most recognizable landmarks in the world and offers breathtaking views of the city.\n2. The Louvre Museum: The Louvre is one of the world's largest and most famous museums, housing an impressive collection of art and artifacts, including the Mona Lisa.\n3. Notre-Dame Cathedral: This beautiful cathedral is one of the most famous landmarks in Paris and is known for its Gothic architecture and stunning stained glass windows.\n\nThese are just a few of the many attractions that Paris has to offer. With so much to see and do, it's no wonder that Paris is one of the most popular tourist destinations in the world."<|end|>
<|user|>
What is so great about #1?<|end|>
<|assistant|>
Sample inference code
This code snippets show how to get quickly started with running the model on a GPU:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
torch.random.manual_seed(0)
model_id = "microsoft/Phi-3-medium-128k-instruct"
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="cuda",
torch_dtype="auto",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
messages = [
{"role": "user", "content": "Can you provide ways to eat combinations of bananas and dragonfruits?"},
{"role": "assistant", "content": "Sure! Here are some ways to eat bananas and dragonfruits together: 1. Banana and dragonfruit smoothie: Blend bananas and dragonfruits together with some milk and honey. 2. Banana and dragonfruit salad: Mix sliced bananas and dragonfruits together with some lemon juice and honey."},
{"role": "user", "content": "What about solving an 2x + 3 = 7 equation?"},
]
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
)
generation_args = {
"max_new_tokens": 500,
"return_full_text": False,
"temperature": 0.0,
"do_sample": False,
}
output = pipe(messages, **generation_args)
print(output[0]['generated_text'])
Runs of duyntnet Phi-3-medium-128k-instruct-imatrix-GGUF on huggingface.co
2.7K
Total runs
0
24-hour runs
-66
3-day runs
-250
7-day runs
-336
30-day runs
More Information About Phi-3-medium-128k-instruct-imatrix-GGUF huggingface.co Model
More Phi-3-medium-128k-instruct-imatrix-GGUF license Visit here:
Phi-3-medium-128k-instruct-imatrix-GGUF huggingface.co is an AI model on huggingface.co that provides Phi-3-medium-128k-instruct-imatrix-GGUF's model effect (), which can be used instantly with this duyntnet Phi-3-medium-128k-instruct-imatrix-GGUF model. huggingface.co supports a free trial of the Phi-3-medium-128k-instruct-imatrix-GGUF model, and also provides paid use of the Phi-3-medium-128k-instruct-imatrix-GGUF. Support call Phi-3-medium-128k-instruct-imatrix-GGUF model through api, including Node.js, Python, http.
Phi-3-medium-128k-instruct-imatrix-GGUF huggingface.co is an online trial and call api platform, which integrates Phi-3-medium-128k-instruct-imatrix-GGUF's modeling effects, including api services, and provides a free online trial of Phi-3-medium-128k-instruct-imatrix-GGUF, you can try Phi-3-medium-128k-instruct-imatrix-GGUF online for free by clicking the link below.
duyntnet Phi-3-medium-128k-instruct-imatrix-GGUF online free url in huggingface.co:
Phi-3-medium-128k-instruct-imatrix-GGUF is an open source model from GitHub that offers a free installation service, and any user can find Phi-3-medium-128k-instruct-imatrix-GGUF on GitHub to install. At the same time, huggingface.co provides the effect of Phi-3-medium-128k-instruct-imatrix-GGUF install, users can directly use Phi-3-medium-128k-instruct-imatrix-GGUF installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Phi-3-medium-128k-instruct-imatrix-GGUF install url in huggingface.co: