upscaler
uwg · Kit
Holds a set of image upscaling models gathered from the OpenModelDB community, for people who want to enlarge low-resolution pictures with AI on their own comp…
A small text generation model that answers questions, continues chat dialogue and completes code. Made for researchers and developers who want a compact open model for safety studies and experiments.
phi-2 is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page, a zip of its files. Nothing in it runs by itself.
pip install -U huggingface_hub hf download microsoft/phi-2
Phi-2 is a small Transformer language model from Microsoft with about 2.7 billion parameters. It writes text from a prompt, in question and answer, chat or code layouts. It was trained on the same data as Phi-1.5 plus synthetic NLP texts and filtered websites. It has not been tuned with reinforcement learning from human feedback.
It suits researchers and developers who want a small, unrestricted model to study toxicity, bias and controllability, or to test ideas on modest hardware.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| AI safety research | Research teams | Study toxicity, societal bias and controllability on a small open model | Probing how the model reacts to risky prompts |
| Education | Teachers and students | Run a small model locally to see how prompting works | Trying question, chat and code prompts side by side |
| Software | Developers | Prototype code completion or question answering | Completing a Python function from its comment |
Skip it for production work, since the card says it was not tested for any production-level application.
| Use case | Who | What they get back |
|---|---|---|
| Question answering | Researchers | A written answer after the question |
| Chat continuation | Developers | The next reply in a dialogue |
| Code completion | Developers | A function body after the comment |
pip install -U huggingface_hub hf download microsoft/phi-2
You write a prompt in the question, chat or code layout, and the model continues the text. For shorter answers, use the Instruct and Output layout. The card warns that an FP16 attention overflow can occur, and says older transformers versions need trust_remote_code set to True.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
torch.set_default_device("cuda")
model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2", torch_dtype="auto", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2", trust_remote_code=True)
outputs = model.generate(**inputs, max_length=200)
text = tokenizer.batch_decode(outputs)[0]
print(text)| Format | What it does |
|---|---|
| Question | A standalone question, with the answer written after it |
| Instruct and Output | Asks for a more concise answer after the Output label |
| Chat | Names like Alice and Bob, and the model writes the next reply |
| Code | A function signature and comment, and the model writes the body |
You ask the model to compare mathematics to a lighthouse, using the Instruct line and an empty Output line. It continues after the Output label with a short written comparison. Treat the result as a starting point and check it yourself.
Phi-2 is a small model that continues whatever text you start. A good first try is the card's lighthouse prompt, and then a short chat between two named people to see how it carries on.
If you know the field, this is a base-style Transformer without reinforcement learning from human feedback. That makes it a plain research subject for safety work. Expect the FP16 attention overflow the card describes, and expect its limits on accuracy for both code and facts.
A small text generation model that answers questions, continues chat dialogue and completes code. Made for researchers and developers who want a compact open model for safety studies and experiments.
Made by microsoft on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.
What it is: Phi-2 is a small Transformer language model from Microsoft with about 2.7 billion parameters. It writes text from a prompt, in question and answer, chat or code layouts. It was trained on the same data as Phi-1.5 plus synthetic NLP texts and filtered websites. It has not been tuned with reinforcement learning from human feedback.
Who it suits: It suits researchers and developers who want a small, unrestricted model to study toxicity, bias and controllability, or to test ideas on modest hardware.
Industry | Who uses it | How they use it | Example
AI safety research | Research teams | Study toxicity, societal bias and controllability on a small open model | Probing how the model reacts to risky prompts
Education | Teachers and students | Run a small model locally to see how prompting works | Trying question, chat and code prompts side by side
Software | Developers | Prototype code completion or question answering | Completing a Python function from its comment
Skip it for production work, since the card says it was not tested for any production-level application.
Where to use it:
Use case | Who | What they get back
Question answering | Researchers | A written answer after the question
Chat continuation | Developers | The next reply in a dialogue
Code completion | Developers | A function body after the comment
How to set it up:
pip install -U huggingface_hub
hf download microsoft/phi-2
How to use it: You write a prompt in the question, chat or code layout, and the model continues the text. For shorter answers, use the Instruct and Output layout. The card warns that an FP16 attention overflow can occur, and says older transformers versions need trust_remote_code set to True.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
torch.set_default_device("cuda")
model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2", torch_dtype="auto", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2", trust_remote_code=True)
outputs = model.generate(**inputs, max_length=200)
text = tokenizer.batch_decode(outputs)[0]
print(text)
Format | What it does
Question | A standalone question, with the answer written after it
Instruct and Output | Asks for a more concise answer after the Output label
Chat | Names like Alice and Bob, and the model writes the next reply
Code | A function signature and comment, and the model writes the body
Example: You ask the model to compare mathematics to a lighthouse, using the Instruct line and an empty Output line. It continues after the Output label with a short written comparison. Treat the result as a starting point and check it yourself.
For newcomers and experts: Phi-2 is a small model that continues whatever text you start. A good first try is the card's lighthouse prompt, and then a short chat between two named people to see how it carries on.
If you know the field, this is a base-style Transformer without reinforcement learning from human feedback. That makes it a plain research subject for safety work. Expect the FP16 attention overflow the card describes, and expect its limits on accuracy for both code and facts.
Write a prompt in one of three formats
Tokenizer turns it into input
The model generates new tokens
Decode the tokens into text
Check the result yourself
Good to know:
Download its files with Hugging Face's command line:
pip install -U huggingface_hub
hf download microsoft/phi-2
Then follow the usage in its model card. Nothing in this kit runs by itself.
README.md 5 KB
Listed Hugging Face models in the same category that share the most tags with this one.
| Product | Downloads, last 30 days | Likes | Parameters | License | Last change |
|---|---|---|---|---|---|
| phi-2 This page | 182,126 | 3,536 | 2.8B | mit | |
| Qwen2.5-Coder-14B-InstructShares code · text-generation · transformers | 1,860,327 | 214 | 14.8B | apache-2.0 | |
| Qwen2.5-Coder-7B-InstructShares code · text-generation · transformers | 1,505,999 | 872 | 7.6B | apache-2.0 | |
| Qwen2.5-Coder-32B-InstructShares code · text-generation · transformers | 546,583 | 2,211 | 32.8B | apache-2.0 | |
| Qwen2.5-Coder-7BShares code · text-generation · transformers | 334,246 | 200 | 7.6B | apache-2.0 | |
| Phi-4-mini-instructShares code · text-generation · transformers | 332,457 | 888 | 3.8B | mit |
Posts and comments that name this project on Hacker News, Bluesky, X, Reddit, Facebook and YouTube, found by a weekly search and on Trendshift. Mindket doesn’t write or check them. Open one to read it where it was posted.
uwg · Kit
Holds a set of image upscaling models gathered from the OpenModelDB community, for people who want to enlarge low-resolution pictures with AI on their own comp…
nerijs · Kit
A pixel art style add-on for Stable Diffusion XL that turns text prompts into pixel-style images, with an optional LCM LoRA for faster runs. For game makers, d…
microsoft · Kit
Turns written conversations into spoken audio with up to four speakers and about 90 minutes of speech, an open Microsoft text-to-speech model for research on p…
masterofaudio2077 · Kit
Reads Egyptian Arabic text aloud and follows the short vowel marks you write into it. A fine-tune of VoiceTut-TTS that keeps its 19 built-in voices and voice c…
hugging-quants · Kit
Runs Meta's Llama 3.1 8B Instruct chat model in 4-bit AWQ form, so it fits on a GPU with about 4 GiB of free memory for the weights. For developers who want a…
besktech · Kit
Scores a Russian-first decision from a context and a list of options, giving a probability for yes/no, choice or rating questions. Runs on a plain CPU, for tea…