Views
No views yet

1from unsloth import FastLanguageModel
2max_seq_length = 2048 # Choose any! We auto support RoPE Scaling internally!
3dtype = (
4 None # None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+
5)
6model, tokenizer = FastLanguageModel.from_pretrained(
7 "bouthros/Mistral-7B-Instruct-v0.1-Unsloth-MedicalQA",
8 max_seq_length=2048,
9 load_in_4bit=True,
10)1messages = [
2 {"from": "human", "value": "What are the types of liver cancer?"},
3]
4inputs = tokenizer.apply_chat_template(
5 messages,
6 tokenize=True,
7 add_generation_prompt=True,
8 return_tensors="pt"
9).to("cuda")