forked from cactus-compute/functiongemma-hackathon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.py
More file actions
26 lines (18 loc) · 629 Bytes
/
Copy pathscripts.py
File metadata and controls
26 lines (18 loc) · 629 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'''
import json
from cactus import cactus_init, cactus_complete, cactus_destroy
model = cactus_init("weights/functiongemma-270m-it")
messages = [{"role": "user", "content": "What is 2+2?"}]
response = json.loads(cactus_complete(model, messages))
print(response["response"])
cactus_destroy(model)
'''
from cactus import cactus_init, cactus_complete, cactus_destroy
import json
model = cactus_init("weights/functiongemma-270m-it")
messages = [{"role": "user", "content": "Compute 2+2 and reply with only the number."}]
raw = cactus_complete(model, messages)
print(raw)
obj = json.loads(raw)
print(obj)
cactus_destroy(model)