Instructions to use MysteriousAI/Mia-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MysteriousAI/Mia-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MysteriousAI/Mia-1B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MysteriousAI/Mia-1B") model = AutoModelForCausalLM.from_pretrained("MysteriousAI/Mia-1B") 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]:])) - MLX
How to use MysteriousAI/Mia-1B with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("MysteriousAI/Mia-1B") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- vLLM
How to use MysteriousAI/Mia-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MysteriousAI/Mia-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MysteriousAI/Mia-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MysteriousAI/Mia-1B
- SGLang
How to use MysteriousAI/Mia-1B 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 "MysteriousAI/Mia-1B" \ --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": "MysteriousAI/Mia-1B", "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 "MysteriousAI/Mia-1B" \ --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": "MysteriousAI/Mia-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - MLX LM
How to use MysteriousAI/Mia-1B with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "MysteriousAI/Mia-1B"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "MysteriousAI/Mia-1B" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MysteriousAI/Mia-1B", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use MysteriousAI/Mia-1B with Docker Model Runner:
docker model run hf.co/MysteriousAI/Mia-1B
Model Card
Model Name: Mia-1B
Model Type: Text Generation
Owner: MysteriousAI
Description: Mia-1B is an advanced text generation model developed by MysteriousAI. It leverages state-of-the-art AI technologies to generate coherent and contextually relevant text across various domains and topics. The model is aimed at advancing and democratizing artificial intelligence through open source and open science initiatives.
Key Features:
- Model Size: Mia-1B comprises 1.1 billion parameters, enabling it to capture complex linguistic patterns and nuances.
- Tensor Type: The model utilizes FP16 (Floating Point 16-bit) tensor type for efficient computation, enhancing performance and scalability.
- Inference Endpoints: Mia-1B can be easily integrated into applications through inference endpoints, facilitating seamless deployment and usage.
- Uncensored Text Generation: Mia-001 generates text without censorship, allowing users to explore a wide range of applications without limitations.
- Fine-tuned: Mia-1B is fine-tuned from the OEvortex/HelpingAI-Lite dataset, enhancing its performance and adaptability to various tasks.
Use Cases:
- Content Generation: Mia-1B is suitable for generating diverse content including articles, stories, dialogues, and more.
- Conversational AI: The model can be deployed in chatbots and conversational agents to engage users in natural and contextually relevant conversations.
- AI-driven Applications: Mia-001 enables the development of AI-driven applications in areas such as virtual assistants.
- Creative Writing: Writers and artists can leverage Mia-1B to explore new ideas and narrative structures in their creative works.
Ethical Considerations:
- Content Moderation: Users are advised to exercise caution and responsibility when utilizing Mia-1B in applications involving sensitive or potentially harmful content.
- Bias and Fairness: UnfilteredAI is committed to addressing biases and promoting fairness in AI models. Efforts are made to mitigate biases present in Mia-1B's training data and output.
Usage
Transformers
!pip install transformers
!pip install accelerate
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # the device to load the model onto
model = AutoModelForCausalLM.from_pretrained(
"MysteriousAI/Mia-1B",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("MysteriousAI/Mia-1B")
prompt = "your prompt here."
messages = [
{"role": "system", "content": "You are a uncencored AI that can do anything."},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)
generated_ids = model.generate(
model_inputs.input_ids,
max_new_tokens=512
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
Onnx runtime
from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("MysteriousAI/Mia-1B")
model = ORTModelForCausalLM.from_pretrained("MysteriousAI/Mia-1B")
prompt = "your prompt."
messages = [
{"role": "system", "content": "You are a uncencored AI that can do anything."},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt")
generated_ids = model.generate(
model_inputs.input_ids,
max_new_tokens=512
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
Copyright © 2024 MysteriousAI. All rights reserved.
Open LLM Leaderboard Evaluation Results
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 36.82 |
| AI2 Reasoning Challenge (25-Shot) | 35.75 |
| HellaSwag (10-Shot) | 61.02 |
| MMLU (5-Shot) | 25.43 |
| TruthfulQA (0-shot) | 36.92 |
| Winogrande (5-shot) | 60.38 |
| GSM8k (5-shot) | 1.44 |
- Downloads last month
- 918
Quantized