Run this model with HF Jobs

Run vikhyatk/moondream2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/vikhyatk/moondream2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/vikhyatk/moondream2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/vikhyatk/moondream2. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/vikhyatk/moondream2. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Fails to load local version: FileNotFoundError: ~/.cache/huggingface/modules/transformers_modules/rope.py

#69
by treehugg3 - opened

I am running via

from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
    "./moondream2",
    trust_remote_code=True,
)

and get:

...
  File "/venv/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 128, in get_relative_import_files
    new_imports.extend(get_relative_imports(f))
  File "/venv/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 97, in get_relative_imports
    with open(module_file, "r", encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/april/.cache/huggingface/modules/transformers_modules/rope.py'

This is basically the same as https://github.com/vikhyat/moondream/issues/256

I am also at my "wit's end"

I got past it by manually copying the files (needed rope.py and also layers.py) from this repo to the location it asked for. But... why is moondream trashing this huggingface directory?

This sounds like a transformers bug... we have it contained in a self-contained executable that should work out of the box here: https://moondream.ai/c/moondream-server

did you solve this? i have same problem.

Any updates? I have this problem as well

Adding the following imports to hf_moondream.py seems to sole this issue:

from .layers import *
from .lora import *
from .rope import *

@vikhyatk could you please update the file to include this imports?

Sign up or log in to comment