Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

hohai
/
gemma4-my-model

Text Generation
MLX
Safetensors
gemma4
unsloth
gemma
google
conversational
Model card Files Files and versions
xet
Community

Instructions to use hohai/gemma4-my-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • MLX

    How to use hohai/gemma4-my-model 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("hohai/gemma4-my-model")
    
    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)
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps Settings
  • LM Studio
  • Unsloth Studio

    How to use hohai/gemma4-my-model 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 hohai/gemma4-my-model 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 hohai/gemma4-my-model to start chatting
    Using HuggingFace Spaces for Unsloth
    # No setup required
    # Open https://huggingface.co/spaces/unsloth/studio in your browser
    # Search for hohai/gemma4-my-model to start chatting
    Load model with FastModel
    pip install unsloth
    from unsloth import FastModel
    model, tokenizer = FastModel.from_pretrained(
        model_name="hohai/gemma4-my-model",
        max_seq_length=2048,
    )
  • MLX LM

    How to use hohai/gemma4-my-model with MLX LM:

    Generate or start a chat session
    # Install MLX LM
    uv tool install mlx-lm
    # Interactive chat REPL
    mlx_lm.chat --model "hohai/gemma4-my-model"
    Run an OpenAI-compatible server
    # Install MLX LM
    uv tool install mlx-lm
    # Start the server
    mlx_lm.server --model "hohai/gemma4-my-model"
    # Calling the OpenAI-compatible server with curl
    curl -X POST "http://localhost:8000/v1/chat/completions" \
       -H "Content-Type: application/json" \
       --data '{
         "model": "hohai/gemma4-my-model",
         "messages": [
           {"role": "user", "content": "Hello"}
         ]
       }'
gemma4-my-model
10.2 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 2 commits
hohai's picture
hohai
Add files using upload-large-folder tool
48f5957 verified 7 days ago
  • .gitattributes
    1.57 kB
    Add files using upload-large-folder tool 7 days ago
  • README.md
    222 Bytes
    Add files using upload-large-folder tool 7 days ago
  • chat_template.jinja
    2.38 kB
    Add files using upload-large-folder tool 7 days ago
  • config.json
    5.83 kB
    Add files using upload-large-folder tool 7 days ago
  • generation_config.json
    208 Bytes
    Add files using upload-large-folder tool 7 days ago
  • model-00001-of-00003.safetensors
    4.53 GB
    xet
    Add files using upload-large-folder tool 7 days ago
  • model-00002-of-00003.safetensors
    5.37 GB
    xet
    Add files using upload-large-folder tool 7 days ago
  • model-00003-of-00003.safetensors
    310 MB
    xet
    Add files using upload-large-folder tool 7 days ago
  • model.safetensors.index.json
    199 kB
    Add files using upload-large-folder tool 7 days ago
  • processor_config.json
    1.32 kB
    Add files using upload-large-folder tool 7 days ago
  • tokenizer.json
    32.2 MB
    xet
    Add files using upload-large-folder tool 7 days ago
  • tokenizer_config.json
    2.69 kB
    Add files using upload-large-folder tool 7 days ago