Instructions to use mrm8488/Alpacoom with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mrm8488/Alpacoom with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mrm8488/Alpacoom")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mrm8488/Alpacoom", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mrm8488/Alpacoom with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mrm8488/Alpacoom" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mrm8488/Alpacoom", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mrm8488/Alpacoom
- SGLang
How to use mrm8488/Alpacoom 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 "mrm8488/Alpacoom" \ --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": "mrm8488/Alpacoom", "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 "mrm8488/Alpacoom" \ --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": "mrm8488/Alpacoom", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mrm8488/Alpacoom with Docker Model Runner:
docker model run hf.co/mrm8488/Alpacoom
Google Colabs I got this error: NameError: name 'bnb' is not defined
#8
by damesek - opened
Hello,
I got this error in Google Colabs (see under my text). I installed !pip install bitsandbytes too, so that couldn't be a problem.. so Im not sure, how to fix. If you have any idea, Im happy to hear :)
Requirement already satisfied: bitsandbytes in /usr/local/lib/python3.9/dist-packages (0.38.1)
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Traceback (most recent call last) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ in <cell line: 2>:2 โ
โ โ
โ /usr/local/lib/python3.9/dist-packages/peft/peft_model.py:143 in from_pretrained โ
โ โ
โ 140 โ โ if config.task_type not in MODEL_TYPE_TO_PEFT_MODEL_MAPPING.keys(): โ
โ 141 โ โ โ model = cls(model, config) โ
โ 142 โ โ else: โ
โ โฑ 143 โ โ โ model = MODEL_TYPE_TO_PEFT_MODEL_MAPPING[config.task_type](model, config) โ
โ 144 โ โ โ
โ 145 โ โ # load weights if any โ
โ 146 โ โ if os.path.exists(os.path.join(model_id, WEIGHTS_NAME)): โ
โ โ
โ /usr/local/lib/python3.9/dist-packages/peft/peft_model.py:514 in __init__ โ
โ โ
โ 511 โ """ โ
โ 512 โ โ
โ 513 โ def __init__(self, model, peft_config: PeftConfig): โ
โ โฑ 514 โ โ super().__init__(model, peft_config) โ
โ 515 โ โ self.base_model_prepare_inputs_for_generation = self.base_model.prepare_inputs_f โ
โ 516 โ โ self.base_model.prepare_inputs_for_generation = self.prepare_inputs_for_generati โ
โ 517 โ
โ โ
โ /usr/local/lib/python3.9/dist-packages/peft/peft_model.py:79 in __init__ โ
โ โ
โ 76 โ โ if isinstance(self.peft_config, PromptLearningConfig): โ
โ 77 โ โ โ self._setup_prompt_encoder() โ
โ 78 โ โ else: โ
โ โฑ 79 โ โ โ self.base_model = LoraModel(peft_config, model) โ
โ 80 โ โ if getattr(self.peft_config, "modules_to_save", None) is not None: โ
โ 81 โ โ โ self.modules_to_save = self.peft_config.modules_to_save โ
โ 82 โ โ โ _set_trainable(self) โ
โ โ
โ /usr/local/lib/python3.9/dist-packages/peft/tuners/lora.py:118 in __init__ โ
โ โ
โ 115 โ โ super().__init__() โ
โ 116 โ โ self.peft_config = config โ
โ 117 โ โ self.model = model โ
โ โฑ 118 โ โ self._find_and_replace() โ
โ 119 โ โ mark_only_lora_as_trainable(self.model, self.peft_config.bias) โ
โ 120 โ โ self.forward = self.model.forward โ
โ 121 โ
โ โ
โ /usr/local/lib/python3.9/dist-packages/peft/tuners/lora.py:148 in _find_and_replace โ
โ โ
โ 145 โ โ โ โ โ is_target_modules_in_base_model = True โ
โ 146 โ โ โ โ parent, target, target_name = self._get_submodules(key) โ
โ 147 โ โ โ โ bias = target.bias is not None โ
โ โฑ 148 โ โ โ โ if loaded_in_8bit and isinstance(target, bnb.nn.Linear8bitLt): โ
โ 149 โ โ โ โ โ kwargs.update( โ
โ 150 โ โ โ โ โ โ { โ
โ 151 โ โ โ โ โ โ โ "has_fp16_weights": target.state.has_fp16_weights, โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
NameError: name 'bnb' is not defined```
I fixed it by pip install bitsandbytes==0.35.0
damesek changed discussion status to closed