DISCLAIMER
: I don't own the weights to this model, this is a property of Microsoft and taken from their official repository :
microsoft/phi-2
.
The sole purpose of this repository is to use this model through the
transformers
API or to load and use the model using the HuggingFace
transformers
library.
Usage
First make sure you have the latest version of the
transformers
installed.
Then use the transformers library to load the model from the library itself
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("susnato/phi-2")
tokenizer = AutoTokenizer.from_pretrained("susnato/phi-2")
inputs = tokenizer('''def print_prime(n): """ Print all primes between 1 and n """''', return_tensors="pt", return_attention_mask=False)
outputs = model.generate(**inputs, max_length=200)
text = tokenizer.batch_decode(outputs)[0]
print(text)
phi-2 huggingface.co is an AI model on huggingface.co that provides phi-2's model effect (), which can be used instantly with this susnato phi-2 model. huggingface.co supports a free trial of the phi-2 model, and also provides paid use of the phi-2. Support call phi-2 model through api, including Node.js, Python, http.
phi-2 huggingface.co is an online trial and call api platform, which integrates phi-2's modeling effects, including api services, and provides a free online trial of phi-2, you can try phi-2 online for free by clicking the link below.
phi-2 is an open source model from GitHub that offers a free installation service, and any user can find phi-2 on GitHub to install. At the same time, huggingface.co provides the effect of phi-2 install, users can directly use phi-2 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.