Instructions to use Norod78/SmolLM-135M-FakyPedia-EngHeb with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Norod78/SmolLM-135M-FakyPedia-EngHeb with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Norod78/SmolLM-135M-FakyPedia-EngHeb") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Norod78/SmolLM-135M-FakyPedia-EngHeb") model = AutoModelForCausalLM.from_pretrained("Norod78/SmolLM-135M-FakyPedia-EngHeb") 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]:])) - llama-cpp-python
How to use Norod78/SmolLM-135M-FakyPedia-EngHeb with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Norod78/SmolLM-135M-FakyPedia-EngHeb", filename="SmolLM-135M-FakyPedia-EngHeb-BF16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use Norod78/SmolLM-135M-FakyPedia-EngHeb with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Norod78/SmolLM-135M-FakyPedia-EngHeb:BF16 # Run inference directly in the terminal: llama-cli -hf Norod78/SmolLM-135M-FakyPedia-EngHeb:BF16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Norod78/SmolLM-135M-FakyPedia-EngHeb:BF16 # Run inference directly in the terminal: llama-cli -hf Norod78/SmolLM-135M-FakyPedia-EngHeb:BF16
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 Norod78/SmolLM-135M-FakyPedia-EngHeb:BF16 # Run inference directly in the terminal: ./llama-cli -hf Norod78/SmolLM-135M-FakyPedia-EngHeb:BF16
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 Norod78/SmolLM-135M-FakyPedia-EngHeb:BF16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Norod78/SmolLM-135M-FakyPedia-EngHeb:BF16
Use Docker
docker model run hf.co/Norod78/SmolLM-135M-FakyPedia-EngHeb:BF16
- LM Studio
- Jan
- vLLM
How to use Norod78/SmolLM-135M-FakyPedia-EngHeb with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Norod78/SmolLM-135M-FakyPedia-EngHeb" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Norod78/SmolLM-135M-FakyPedia-EngHeb", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Norod78/SmolLM-135M-FakyPedia-EngHeb:BF16
- SGLang
How to use Norod78/SmolLM-135M-FakyPedia-EngHeb 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 "Norod78/SmolLM-135M-FakyPedia-EngHeb" \ --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": "Norod78/SmolLM-135M-FakyPedia-EngHeb", "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 "Norod78/SmolLM-135M-FakyPedia-EngHeb" \ --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": "Norod78/SmolLM-135M-FakyPedia-EngHeb", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Norod78/SmolLM-135M-FakyPedia-EngHeb with Ollama:
ollama run hf.co/Norod78/SmolLM-135M-FakyPedia-EngHeb:BF16
- Unsloth Studio new
How to use Norod78/SmolLM-135M-FakyPedia-EngHeb 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 Norod78/SmolLM-135M-FakyPedia-EngHeb 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 Norod78/SmolLM-135M-FakyPedia-EngHeb to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Norod78/SmolLM-135M-FakyPedia-EngHeb to start chatting
- Docker Model Runner
How to use Norod78/SmolLM-135M-FakyPedia-EngHeb with Docker Model Runner:
docker model run hf.co/Norod78/SmolLM-135M-FakyPedia-EngHeb:BF16
- Lemonade
How to use Norod78/SmolLM-135M-FakyPedia-EngHeb with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Norod78/SmolLM-135M-FakyPedia-EngHeb:BF16
Run and chat with the model
lemonade run user.SmolLM-135M-FakyPedia-EngHeb-BF16
List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)SmolLM-135M-FakyPedia-EngHeb
Table of Contents
Model Details
Base Model
This model extended the tokenizer of and is a fine-tuned of SmolLM-135M-Instruct
Model Description:
A bilingual (English and Hebrew) nonsense generation model which produces silly Wikipedia-like abstract text.
- Fine tuned by: Doron Adler
- Model Type: Text Generation
- Language(s): English, Hebrew
- License: apache-2.0 (as a derived work of SmolLM)
Uses
Input format
BOS-TOKEN followed by '\%' followed by the optional title for the fake "Wikipedia" article
Generation
pip install transformers
# pip install transformers
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model_id = "Norod78/SmolLM-135M-FakyPedia-EngHeb"
tokenizer = AutoTokenizer.from_pretrained(model_id)
tokenizer.pad_token_id = tokenizer.eos_token_id
bos_token = tokenizer.bos_token
model = AutoModelForCausalLM.from_pretrained(model_id).to(device)
model.generation_config.pad_token_id = tokenizer.pad_token_id
torch.manual_seed(1234)
def generate_fakypedia(article_title: str):
with torch.no_grad():
result = ""
string_to_tokenize= f"{bos_token}\\%{article_title}"
input_ids = tokenizer( string_to_tokenize, return_tensors="pt").input_ids.to(device)
sample_outputs = model.generate(input_ids, do_sample=True,repetition_penalty=1.05, top_k = 40, top_p = 0.950, temperature=0.80, max_length=192, num_return_sequences=3)
#sample_outputs = model.generate(input_ids, do_sample=True,repetition_penalty=1.2, temperature=0.5, max_length=192, num_return_sequences=3)
if article_title == None or len(article_title) == 0:
result += f"# Fakypedia results with random titles \n"
article_title = ""
else:
result += f"# Fakypedia results for \"{article_title}\" \n"
for i, sample_output in enumerate(sample_outputs):
decoded_output = tokenizer.decode(sample_output, skip_special_tokens=True)
decoded_output = decoded_output.replace(f"\%{article_title}", f"## {i+1}. {article_title}").replace("\%", " ").replace("\\n", " \n")
decoded_output = decoded_output.replace("## \n", "\n")
result += "{}\n".format(decoded_output)
return result
generate_fakypedia("Hugging Face")
Generate with llama.cpp
Download SmolLM-135M-FakyPedia-EngHeb-BF16.gguf
Run:
llama-cli -m SmolLM-135M-FakyPedia-EngHeb-BF16.gguf -p "<|endoftext|>\\%Hugging Face"
Misuse and Out-of-scope Use
Risks, Limitations and Biases
CONTENT WARNING: Readers should be aware this section contains content that is disturbing, offensive, and can propagate historical and current stereotypes.
This model is basically a joke and intended to generate silly and fake results.
Training
Training Data
Training Procedure
- A tokenizer with vocab size of 14,000 was trained
- The trained tokenizer was then merged at the end of the base model's tokenizer using this script so the original base model knowledge was retained as well as make it better fine-tunable upon Hebrew text
- Hebrew and English datasets were interleaved so each language had an identical amount of samples.
- Each example was processed in the following manner:
def add_prefix(example):
example["text"] = ("\%" + example["title"] + "\%\n" + example["text"]).replace("\n", "\\n")
return example
- Downloads last month
- 124
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Norod78/SmolLM-135M-FakyPedia-EngHeb", filename="SmolLM-135M-FakyPedia-EngHeb-BF16.gguf", )