Views
No views yet
1import CoreMLPipelines
2
3let pipeline = try await TextGenerationPipeline(
4 modelName: "finnvoorhees/coreml-SmolLM2-135M-Instruct-4bit"
5)
6let stream = pipeline(
7 messages: [[
8 "role": "user",
9 "content": "Write a poem about Ireland"
10 ]]
11)
12for try await text in stream {
13 print(text, terminator: "")
14 fflush(stdout)
15}
16print("")