fix lora uploads (we were calling it wrong)

This commit is contained in:
Brandon Thomas committed 2024-02-10 17:31:10 -05:00
1 parent f736da28ae
commit fbb0962b4d
2 files changed
+29 -7

No files matched your search

@@ -0,0 +1,22 @@
import MakeRequest from "../MakeRequest";
export interface UploadLoraRequest {
uuid_idempotency_token: String,
//type_of_inference: String, // upload_lora / check_point / inference
//maybe_upload_path?: String,
maybe_lora_upload_path?: String,
maybe_name: String,
maybe_description: String,
visibility: String,
}
export interface UploadLoraResponse {
success: boolean,
maybe_sd_model_token?: String,
maybe_lora_model_token?: String,
}
export const UploadLora = MakeRequest<string, UploadLoraRequest, UploadLoraResponse,{}>({
method: "POST",
routingFunction: () => "/v1/image_gen/upload/lora",
});
@@ -1,5 +1,5 @@
import { useState } from "react";
import { UploadModel } from "@storyteller/components/src/api/image_generation/UploadModel";
import { UploadLora } from "@storyteller/components/src/api/image_generation/UploadLora";
import { FetchStatus } from "@storyteller/components/src/api/_common/SharedFetchTypes";
import { useCoverImgUpload, useInferenceJobs } from "hooks";
import { FrontendInferenceJobType } from "@storyteller/components/src/jobs/InferenceJob";
@@ -28,15 +28,15 @@ export default function useLoraUpload() {
const upload = () => {
writeStatusSet(FetchStatus.in_progress);
UploadModel("", {
...(coverImg.token
? { cover_image_media_file_token: coverImg.token }
: {}),
UploadLora("", {
//...(coverImg.token
// ? { cover_image_media_file_token: coverImg.token }
// : {}),
maybe_name: title,
maybe_description: descriptionMD,
uuid_idempotency_token: uuidv4(),
type_of_inference: "inference",
maybe_upload_path: uploadPath,
//type_of_inference: "inference",
maybe_lora_upload_path: uploadPath,
visibility,
})
.then((res: any) => {