Views
No views yet
1from unsloth import FastLanguageModel
2
3model, tokenizer = FastLanguageModel.from_pretrained(
4 model_name = "kavya-17b/medical-chatdoctor-mistral7b",
5 load_in_4bit = True,
6)
7FastLanguageModel.for_inference(model)
8
9prompt = """### Instruction:
10You are a helpful and accurate medical assistant.
11
12### Patient:
13I have had a persistent cough for 3 weeks with mild fever. What could this be?
14
15### Doctor:
16"""
17
18inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
19outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.7, do_sample=True)
20print(tokenizer.decode(outputs[0], skip_special_tokens=True))