File tree Expand file tree Collapse file tree 2 files changed +1
-27
lines changed
Expand file tree Collapse file tree 2 files changed +1
-27
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { typedInclude } from "../utils/typedInclude";
88export const inferenceProviderMappingCache = new Map < ModelId , InferenceProviderMapping > ( ) ;
99
1010export type InferenceProviderMapping = Partial <
11- Record < InferenceProvider , Omit < InferenceProviderModelMapping , "hfModelId" | "adapterWeightsPath" > >
11+ Record < InferenceProvider , Omit < InferenceProviderModelMapping , "hfModelId" > >
1212> ;
1313
1414export interface InferenceProviderModelMapping {
@@ -74,22 +74,6 @@ export async function getInferenceProviderMapping(
7474 `Model ${ params . modelId } is in staging mode for provider ${ params . provider } . Meant for test purposes only.`
7575 ) ;
7676 }
77- if ( providerMapping . adapter === "lora" ) {
78- const treeResp = await ( options ?. fetch ?? fetch ) ( `${ HF_HUB_URL } /api/models/${ params . modelId } /tree/main` ) ;
79- if ( ! treeResp . ok ) {
80- throw new Error ( `Unable to fetch the model tree for ${ params . modelId } .` ) ;
81- }
82- const tree : Array < { type : "file" | "directory" ; path : string } > = await treeResp . json ( ) ;
83- const adapterWeightsPath = tree . find ( ( { type, path } ) => type === "file" && path . endsWith ( ".safetensors" ) ) ?. path ;
84- if ( ! adapterWeightsPath ) {
85- throw new Error ( `No .safetensors file found in the model tree for ${ params . modelId } .` ) ;
86- }
87- return {
88- ...providerMapping ,
89- hfModelId : params . modelId ,
90- adapterWeightsPath,
91- } ;
92- }
9377 return { ...providerMapping , hfModelId : params . modelId } ;
9478 }
9579 return null ;
Original file line number Diff line number Diff line change @@ -86,16 +86,6 @@ export class FalAITextToImageTask extends FalAITask implements TextToImageTaskHe
8686 ...( params . args . parameters as Record < string , unknown > ) ,
8787 sync_mode : true ,
8888 prompt : params . args . inputs ,
89- ...( params . mapping ?. adapter === "lora" && params . mapping . adapterWeightsPath
90- ? {
91- loras : [
92- {
93- path : buildLoraPath ( params . mapping . hfModelId , params . mapping . adapterWeightsPath ) ,
94- scale : 1 ,
95- } ,
96- ] ,
97- }
98- : undefined ) ,
9989 } ;
10090
10191 if ( params . mapping ?. adapter === "lora" && params . mapping . adapterWeightsPath ) {
You can’t perform that action at this time.
0 commit comments