| language: | |
| - en | |
| library_name: coreml | |
| license: apache-2.0 | |
| pipeline_tag: text-generation | |
| tags: | |
| - CoreMLPipelines | |
| # coreml-SmolLM2-135M-Instruct-8bit | |
| This model was converted from [HuggingFaceTB/SmolLM2-135M-Instruct](https://hf.co/HuggingFaceTB/SmolLM2-135M-Instruct) to CoreML using [coremlpipelinestools](https://github.com/finnvoor/CoreMLPipelines/tree/main/coremlpipelinestools). | |
| ### Use with [CoreMLPipelines](https://github.com/finnvoor/CoreMLPipelines) | |
| ```swift | |
| import CoreMLPipelines | |
| let pipeline = try await TextGenerationPipeline( | |
| modelName: "finnvoorhees/coreml-SmolLM2-135M-Instruct-8bit" | |
| ) | |
| let stream = pipeline( | |
| messages: [[ | |
| "role": "user", | |
| "content": "Write a poem about Ireland" | |
| ]] | |
| ) | |
| for try await text in stream { | |
| print(text, terminator: "") | |
| fflush(stdout) | |
| } | |
| print("") | |
| ``` | |