-
Notifications
You must be signed in to change notification settings - Fork 40
fix: use convertTranscriptToMLXChat in streamResponse #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Hi @XMLHexagram. Thank you for opening this PR. I'm sorry for the inconvenience caused by the current code not working. I just merged #67, which I believe makes an equivalent change. Is there anything in here that we'd be missing? (I see there are some changes around how parameters are encoded; are those required?) |
|
@mattt, Yes, I believe these code are indeed important. Cause #67 only fix part of the error. After 0.5.2 published, run ❯ swift build --traits MLX
[1/1] Planning build
Building for debugging...
/Users/hexagram/Projects/AnyLanguageModel/Sources/AnyLanguageModel/Models/MLXLanguageModel.swift:377:25: error: type 'Any' does not conform to the 'Sendable' protocol
375 | return [
376 | "type": "function",
377 | "function": [
| `- error: type 'Any' does not conform to the 'Sendable' protocol
378 | "name": tool.name,
379 | "description": tool.description,
[5/5] Compiling AnyLanguageModel MLXLanguageModel.swiftAs a result, 0.5.2 is still broken if developer enable MLX trait. And this PR fully fix all the errors and I have already completely tested it in my own project. BTW, next time before merging PR or release new version, please make sure it is worked properly. |
|
And I also fix the error in CoreML trait in this PR. /Users/hexagram/Projects/AnyLanguageModel/Sources/AnyLanguageModel/Models/CoreMLLanguageModel.swift:219:45: error: value of type 'Instructions' has no member 'segments'
217 | // Check for image segments in instructions
218 | if let instructions = session.instructions {
219 | for segment in instructions.segments {
| `- error: value of type 'Instructions' has no member 'segments'
220 | if case .image = segment {
221 | throw CoreMLLanguageModelError.unsupportedFeature
/Users/hexagram/Projects/AnyLanguageModel/Sources/AnyLanguageModel/Models/CoreMLLanguageModel.swift:219:45: error: value of type 'Instructions' has no member 'segments'
217 | // Check for image segments in instructions
218 | if let instructions = session.instructions {
219 | for segment in instructions.segments {
| `- error: value of type 'Instructions' has no member 'segments'
220 | if case .image = segment {
221 | throw CoreMLLanguageModelError.unsupportedFeature
[75/75] Compiling AnyLanguageModel GenerationID.swift |
Pretty sure it compiled before I raised PR. Also tested in my project. |
May I ask your swift version? via Mine is ❯ swift --version
swift-driver version: 1.127.14.1 Apple Swift version 6.2.1 (swiftlang-6.2.1.4.8 clang-1700.4.4.1)
Target: arm64-apple-macosx26.0 |
|


fix #70