Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ def get_ckpt_names(token, radio_model_names, input_model):
|
|
40 |
except Exception as e:
|
41 |
return error_str(e), gr.update(choices=[]), None
|
42 |
|
43 |
-
def convert_and_push(radio_model_names, input_model, ckpt_name, token):
|
44 |
|
45 |
model_id = url_to_model_id(input_model) if radio_model_names == "Other" else radio_model_names
|
46 |
|
@@ -68,6 +68,7 @@ def convert_and_push(radio_model_names, input_model, ckpt_name, token):
|
|
68 |
upload_folder(
|
69 |
folder_path=model_id,
|
70 |
repo_id=model_id,
|
|
|
71 |
token=token,
|
72 |
create_pr=True,
|
73 |
commit_message=commit_message,
|
@@ -122,6 +123,7 @@ with gr.Blocks() as demo:
|
|
122 |
with gr.Column(visible=False) as group_convert:
|
123 |
gr.Markdown("## 2. Convert to Diffusers🧨")
|
124 |
radio_ckpts = gr.Radio(label="Choose the checkpoint to convert", visible=False)
|
|
|
125 |
gr.Markdown("Conversion may take a few minutes.")
|
126 |
btn_convert = gr.Button("Convert & Push")
|
127 |
|
@@ -151,7 +153,7 @@ with gr.Blocks() as demo:
|
|
151 |
|
152 |
btn_convert.click(
|
153 |
fn=convert_and_push,
|
154 |
-
inputs=[radio_model_names, input_model, radio_ckpts, input_token],
|
155 |
outputs=error_output,
|
156 |
scroll_to_output=True
|
157 |
)
|
|
|
40 |
except Exception as e:
|
41 |
return error_str(e), gr.update(choices=[]), None
|
42 |
|
43 |
+
def convert_and_push(radio_model_names, input_model, ckpt_name, token, path_in_repo):
|
44 |
|
45 |
model_id = url_to_model_id(input_model) if radio_model_names == "Other" else radio_model_names
|
46 |
|
|
|
68 |
upload_folder(
|
69 |
folder_path=model_id,
|
70 |
repo_id=model_id,
|
71 |
+
path_in_repo=path_in_repo,
|
72 |
token=token,
|
73 |
create_pr=True,
|
74 |
commit_message=commit_message,
|
|
|
123 |
with gr.Column(visible=False) as group_convert:
|
124 |
gr.Markdown("## 2. Convert to Diffusers🧨")
|
125 |
radio_ckpts = gr.Radio(label="Choose the checkpoint to convert", visible=False)
|
126 |
+
path_in_repo = gr.Textbox(label="Path where the weights will be saved", palceholder="Leave empty for root folder")
|
127 |
gr.Markdown("Conversion may take a few minutes.")
|
128 |
btn_convert = gr.Button("Convert & Push")
|
129 |
|
|
|
153 |
|
154 |
btn_convert.click(
|
155 |
fn=convert_and_push,
|
156 |
+
inputs=[radio_model_names, input_model, radio_ckpts, input_token, path_in_repo],
|
157 |
outputs=error_output,
|
158 |
scroll_to_output=True
|
159 |
)
|