Instructions to use sapienzanlp/Minerva-3B-base-v1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sapienzanlp/Minerva-3B-base-v1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sapienzanlp/Minerva-3B-base-v1.0")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sapienzanlp/Minerva-3B-base-v1.0") model = AutoModelForCausalLM.from_pretrained("sapienzanlp/Minerva-3B-base-v1.0") - llama-cpp-python
How to use sapienzanlp/Minerva-3B-base-v1.0 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="sapienzanlp/Minerva-3B-base-v1.0", filename="minerva-3b.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use sapienzanlp/Minerva-3B-base-v1.0 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf sapienzanlp/Minerva-3B-base-v1.0 # Run inference directly in the terminal: llama-cli -hf sapienzanlp/Minerva-3B-base-v1.0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf sapienzanlp/Minerva-3B-base-v1.0 # Run inference directly in the terminal: llama-cli -hf sapienzanlp/Minerva-3B-base-v1.0
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf sapienzanlp/Minerva-3B-base-v1.0 # Run inference directly in the terminal: ./llama-cli -hf sapienzanlp/Minerva-3B-base-v1.0
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf sapienzanlp/Minerva-3B-base-v1.0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf sapienzanlp/Minerva-3B-base-v1.0
Use Docker
docker model run hf.co/sapienzanlp/Minerva-3B-base-v1.0
- LM Studio
- Jan
- vLLM
How to use sapienzanlp/Minerva-3B-base-v1.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sapienzanlp/Minerva-3B-base-v1.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sapienzanlp/Minerva-3B-base-v1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sapienzanlp/Minerva-3B-base-v1.0
- SGLang
How to use sapienzanlp/Minerva-3B-base-v1.0 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 "sapienzanlp/Minerva-3B-base-v1.0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sapienzanlp/Minerva-3B-base-v1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "sapienzanlp/Minerva-3B-base-v1.0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sapienzanlp/Minerva-3B-base-v1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use sapienzanlp/Minerva-3B-base-v1.0 with Ollama:
ollama run hf.co/sapienzanlp/Minerva-3B-base-v1.0
- Unsloth Studio new
How to use sapienzanlp/Minerva-3B-base-v1.0 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sapienzanlp/Minerva-3B-base-v1.0 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sapienzanlp/Minerva-3B-base-v1.0 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for sapienzanlp/Minerva-3B-base-v1.0 to start chatting
- Docker Model Runner
How to use sapienzanlp/Minerva-3B-base-v1.0 with Docker Model Runner:
docker model run hf.co/sapienzanlp/Minerva-3B-base-v1.0
- Lemonade
How to use sapienzanlp/Minerva-3B-base-v1.0 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull sapienzanlp/Minerva-3B-base-v1.0
Run and chat with the model
lemonade run user.Minerva-3B-base-v1.0-{{QUANT_TAG}}List all available models
lemonade list
π© Report: Ethical issue(s)
Hello SapienzaNLP team. We have noticed that your model can produce toxic content (e.g., racist, sexist) in Italian, and we have been able to reproduce them. We can provide them privately, but prefer not to share here publicly.
For reference, this is our content policy: https://huggingface.co/content-guidelines
Reach out to us if we can assist you. Thanks for your cooperation.
Hi there,
Thank you for bringing this to our attention. We are aware of the potential for generating problematic content, as our model is a base version focused primarily on research purposes and has not undergone alignment or red teaming processes.
We would be grateful for any suggestions on incorporating a clear message or disclaimer in our model card to better inform users of these limitations. For now, we have taken the message from Bloom as reference:
π¨β οΈπ¨ Bias, Risks, and Limitations π¨β οΈπ¨
This section identifies foreseeable harms and misunderstandings.
This is a foundation model, not subject to alignment. Model may:
Overrepresent some viewpoints and underrepresent others
Contain stereotypes
Contain personal information
Generate:
Hateful, abusive, or violent language
Discriminatory or prejudicial language
Content that may not be appropriate for all settings, including sexual content
Make errors, including producing incorrect information as if it were factual
Generate irrelevant or repetitive outputs
Furthermore, it's important to note that we have observed similar behavior in such other base models, and we don't think this is a unique issue with Minerva. Our training corpus consists solely of CulturaX which is itself hosted in Huggingface. We are keen to collaborate with the research community and HF to enhance model safety across the board and we find that exploring the results of training on such available web datasets, especially for non-english data, is important.
Thank you for your cooperation, and we look forward to your guidance.
Best regards,
SapienzaNLP team.
Maybe this shouldn't have been released before solving the bias problem.
Thank you for your swift reply, @PereLluis13 .
I opened a PR to suggest some more accurate details to add to the model card. In the meanwhile, I suggest you disable the inference API -- it's easier to do from your side directly.
As mentioned elsewhere, if the model is intended for research purposes only for now, it should also be clearly stated at the beginning of the model card.
Thank you for your cooperation, and feel free to reach out if I can help with anything else.