Views
No views yet
1question = "What are the common symptoms of diabetes?"
2 system_prompt = """You are a medical AI assistant. Provide detailed reasoning before giving your final answer.
3 Respond in the following format:
4
5 <reasoning>
6 ...
7 </reasoning>
8 <answer>
9 ...
10 </answer>
11 """
12
13 prompt = [
14 {'role': 'system', 'content': system_prompt},
15 {'role': 'user', 'content': question}
16 ]
17
18 inputs = tokenizer.apply_chat_template(prompt, return_tensors="pt")
19 outputs = model.generate(inputs, max_new_tokens=512)
20 response = tokenizer.decode(outputs[0], skip_special_tokens=True)
21 print(response)
22