Views
No views yet
ollama run hf.co/adeebaldkheel/ALLaM-7B-Instruct-preview-reasoning1from openai import OpenAI
2
3client = OpenAI(
4 base_url='http://localhost:11434/v1/',
5
6 # required but ignored
7 api_key='ollama',
8)
9
10# Create a chat completion request to the Ollama server.
11response = client.chat.completions.create(
12 model="hf.co/adeebaldkheel/ALLaM-7B-Instruct-preview-reasoning:latest", # Specify the model available on your Ollama server.
13 messages=[
14 {"role": "system", "content": """أجب بالصيغة التالية:
15<think>
16خطوات ايجاد الحل هنا
17</think>
18<answer>
19الإجابة النهائية هنا
20</answer>"""},
21 {"role": "user", "content": """أوجد قيمة x في المعادلة التالية:
22 2x + 3 = 7"""}
23 ],
24 max_tokens=4096,
25 temperature=0.4,
26 top_p=0.95,
27)
28
29# Output the response from the AI.
30print(response.choices[0].message.content)
31# Output:
32"""
33<think>
34لحل المعادلة، نتبع الخطوات التالية:
351. نطرح 3 من كلا الجانبين للتخلص من العدد الثابت على الجانب الأيسر:
36 2x + 3 - 3 = 7 - 3
37 2x = 4
38
392. نقسم كلا الجانبين على 2 لحل x:
40 (2x)/2 = 4/2
41 x = 2
42</think>
43<answer>
44قيمة x هي 2.
45</answer>
46"""
47
