Views
No views yet

pip install mlx-lm1from mlx_lm import load, generate
2
3
4model, tokenizer = load('danilopeixoto/pandora-7b-chat')
5
6prompt = '''<|start|>system
7You are Pandora, a helpful AI assistant.
8<|end|>
9<|start|>user
10Hello!
11<|end|>
12<|start|>'''
13
14response = generate(model, tokenizer, prompt)
15print(response)1<|start|>system
2{system_message}
3<|end|>
4<|start|>user
5{user_message}
6<|end|>
7<|start|>assistant
8{assistant_message}
9<|end|>1<|start|>system
2{system_message}
3<|end|>
4<|start|>system:tools
5{system_tools_message}
6<|end|>
7<|start|>user
8{user_message}
9<|end|>
10<|start|>assistant:tool_calls
11{assistant_tool_calls_message}
12<|end|>
13<|start|>tool
14{tool_message}
15<|end|>
16<|start|>assistant
17{assistant_message}
18<|end|>Note The variablessystem_tools_message,assistant_tool_calls_message, andtool_messagemust contain valid YAML.
1prompt = '''<|start|>system
2You are Pandora, a helpful AI assistant.
3<|end|>
4<|start|>system:tools
5- description: Get the current weather based on a given location.
6 name: get_current_weather
7 parameters:
8 type: object
9 properties:
10 location:
11 type: string
12 description: The location name.
13 required:
14 - location
15<|end|>
16<|start|>user
17What is the weather in Sydney, Australia?
18<|end|>
19<|start|>assistant:tool_calls
20- name: get_current_weather
21 arguments:
22 location: Sydney, Australia
23<|end|>
24<|start|>tool
25name: get_current_weather
26content: 72°F
27<|end|>
28<|start|>'''