File tree Expand file tree Collapse file tree 6 files changed +9
-8
lines changed
Expand file tree Collapse file tree 6 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 11## 0.0.52
2- * INCOMPLETE*
2+ + Fixed remote predictions resulting in prediction errors.
3+ + Updated OpenAI client to default to local inference.
34
45## 0.0.51
56+ Added ` muna.beta.predictions.remote.stream ` method to stream remote predictions.
Original file line number Diff line number Diff line change @@ -100,15 +100,15 @@ export class ChatCompletionService {
100100 public create ( body : ChatCompletionCreateParamsStreaming ) : Promise < AsyncGenerator < ChatCompletionChunk > > ;
101101 public create ( body : ChatCompletionCreateParamsBase ) : Promise < ChatCompletion | AsyncGenerator < ChatCompletionChunk > > ;
102102 public async create ( body : ChatCompletionCreateParams ) : Promise < ChatCompletion | AsyncGenerator < ChatCompletionChunk > > {
103- const { model : tag , ...params } = body ;
103+ const { model : tag , acceleration = "local_auto" , ...params } = body ;
104104 // Ensure we have a delegate
105105 if ( ! this . cache . has ( tag ) ) {
106106 const delegate = await this . createDelegate ( tag ) ;
107107 this . cache . set ( tag , delegate ) ;
108108 }
109109 // Make prediction
110110 const delegate = this . cache . get ( tag ) ;
111- const response = await delegate ( { ...params } ) ;
111+ const response = await delegate ( { ...params , acceleration } ) ;
112112 // Return
113113 return response ;
114114 }
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ export class EmbeddingService {
5858 model : tag ,
5959 input,
6060 encoding_format = "float" ,
61- acceleration = "remote_auto "
61+ acceleration = "local_auto "
6262 } : EmbeddingCreateParams ) : Promise < CreateEmbeddingResponse > {
6363 // Ensure we have a delegate
6464 if ( ! this . cache . has ( tag ) ) {
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export class SpeechService {
7171 response_format = "mp3" ,
7272 speed = 1.0 ,
7373 stream_format = "audio" ,
74- acceleration = "remote_auto "
74+ acceleration = "local_auto "
7575 } : SpeechCreateParams ) : Promise < Response > {
7676 // Ensure we have a delegate
7777 if ( ! this . cache . has ( tag ) ) {
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export class RemotePredictionService {
4545 . entries ( inputs )
4646 . map ( async ( [ name , object ] ) => [
4747 name ,
48- await createRemoteValue ( { object } )
48+ await createRemoteValue ( object )
4949 ] satisfies [ string , RemoteValue ] )
5050 ) ) ;
5151 this . fxnc ??= await getFxnc ( ) ;
Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ class RemotePredictionTest {
2222 @mocha . test
2323 async "Should create a remote prediction" ( ) {
2424 const prediction = await this . muna . beta . predictions . remote . create ( {
25- tag : "@fxn/greeting " ,
26- inputs : { name : "Yusuf" }
25+ tag : "@yusuf/area " ,
26+ inputs : { radius : 3 }
2727 } ) ;
2828 const results = prediction . results ;
2929 expect ( results ) . to . not . be . empty ;
You can’t perform that action at this time.
0 commit comments