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
Update handler.py
Browse files3 unmodified lines4567891011121314151617181920212223242526272829303132333435363738394041424344453 unmodified linesREPOSITORY_ID = "exillarml/Mistral7b_11Labs_DoctorDS_Testing"# Load tokenizertokenizer = AutoTokenizer.from_pretrained(REPOSITORY_ID)# 4-bit quantization configbnb_config = BitsAndBytesConfig(load_in_4bit=True,bnb_4bit_use_double_quant=True,bnb_4bit_quant_type="nf4",bnb_4bit_compute_dtype=torch.bfloat16)# Load the base model with quantizationmodel = AutoModelForCausalLM.from_pretrained("unsloth/mistral-7b-bnb-4bit",quantization_config=bnb_config,trust_remote_code=True,device_map="auto")tokenizer.pad_token = tokenizer.eos_token# Load the LoRA adaptermodel = PeftModel.from_pretrained(model, REPOSITORY_ID)# Create the text generation pipelinepipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer)def handler(inputs):# Get the prompt from the inputprompt = inputs.get("prompt", "") # Get the prompt, or use an empty string if not provided# Generate textgenerated_text = pipe(prompt, max_length=100)[0]["generated_text"]# Return the generated text in the correct format for the handlerreturn {"generated_text": generated_text}3 unmodified lines456789101112131415161718192021222324252627283 unmodified linesREPOSITORY_ID = "exillarml/Mistral7b_11Labs_DoctorDS_Testing"# Load the base model with quantizationmodel = 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 tokentokenizer = AutoTokenizer.from_pretrained(REPOSITORY_ID) # Your repo ID.tokenizer.pad_token = tokenizer.eos_token# Load the LoRA adaptermodel = PeftModel.from_pretrained(model, REPOSITORY_ID) # Your repo ID# Create the text generation pipelinepipe = 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}
handler.py+7-24