Run this model with HF Jobs
Run exillarml/Mistral7b_11Labs_DoctorDS_Testing 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 to fine-tune https://huggingface.co/exillarml/Mistral7b_11Labs_DoctorDS_Testing. 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/exillarml/Mistral7b_11Labs_DoctorDS_Testing 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.
Instructions to use exillarml/Mistral7b_11Labs_DoctorDS_Testing with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use exillarml/Mistral7b_11Labs_DoctorDS_Testing with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("exillarml/Mistral7b_11Labs_DoctorDS_Testing", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
Download handler.py from exillarml/Mistral7b_11Labs_DoctorDS_Testing: direct link, hf CLI and curl.
- Browser
- Download file 930 Bytes
-
https://huggingface.co/exillarml/Mistral7b_11Labs_DoctorDS_Testing/resolve/main/handler.py
- Command line
-
hf download hf://exillarml/Mistral7b_11Labs_DoctorDS_Testing/handler.py
-
curl -L -o handler.py https://huggingface.co/exillarml/Mistral7b_11Labs_DoctorDS_Testing/resolve/main/handler.py
930 Bytes
| from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, pipeline | |
| import torch | |
| from peft import PeftModel | |
| REPOSITORY_ID = "exillarml/Mistral7b_11Labs_DoctorDS_Testing" | |
| # Load the base model with quantization | |
| model = AutoModelForCausalLM.from_pretrained( | |
| "unsloth/mistral-7b-bnb-4bit", | |
| load_in_4bit=True, | |
| trust_remote_code=True, | |
| device_map="auto" | |
| ) | |
| # Load the tokenizer and set the pad token | |
| tokenizer = AutoTokenizer.from_pretrained(REPOSITORY_ID) # Your repo ID. | |
| tokenizer.pad_token = tokenizer.eos_token | |
| # Load the LoRA adapter | |
| model = PeftModel.from_pretrained(model, REPOSITORY_ID) # Your repo ID | |
| # Create the text generation pipeline | |
| pipe = pipeline("text-generation", model=model, tokenizer=tokenizer) | |
| def handler(inputs): | |
| prompt = inputs.get("prompt", "") | |
| generated_text = pipe(prompt, max_length=100)[0]["generated_text"] | |
| return {"generated_text": generated_text} |