@@ -8,7 +8,7 @@ class Box(BaseModel):
88 width : int
99 height : int
1010 depth : int
11- units : str
11+ units : int
1212
1313
1414def transformers_example ():
@@ -22,8 +22,8 @@ def transformers_example():
2222 chat_template = '{% for message in messages %}{{ message.role }}: {{ message.content }}{% endfor %}'
2323 hf_tokenizer .chat_template = chat_template
2424
25- model = OutlinesModel .transformers (hf_model , hf_tokenizer , settings = ModelSettings (max_new_tokens = 100 ))
26- agent = Agent (model , output_type = NativeOutput ( [Box ]) )
25+ model = OutlinesModel .from_transformers (hf_model , hf_tokenizer , settings = ModelSettings (max_new_tokens = 100 ))
26+ agent = Agent (model , output_type = [Box ])
2727
2828 response = agent .run_sync ('Give me the dimensions of a box' )
2929 print ("response.output: " , response .output )
@@ -47,7 +47,7 @@ def llama_cpp_example():
4747 n_ctx = 2048 , # 2K context window
4848 )
4949
50- model = OutlinesModel .llama_cpp (llama_model )
50+ model = OutlinesModel .from_Somllama_cpp (llama_model )
5151 agent = Agent (model , output_type = NativeOutput ([Box ]))
5252
5353 response = agent .run_sync ('Give me the dimensions of a box' )
@@ -62,6 +62,6 @@ def llama_cpp_example():
6262
6363
6464if __name__ == "__main__" :
65- # transformers_example()
66- llama_cpp_example ()
65+ transformers_example ()
66+ # llama_cpp_example()
6767 #existing()
0 commit comments