hysts commited on
Commit
6cbaef8
1 Parent(s): ccc363e

Update default values and add some explanations

Browse files
Files changed (3) hide show
  1. app.py +3 -0
  2. app_training.py +7 -2
  3. app_upload.py +2 -4
app.py CHANGED
@@ -68,6 +68,9 @@ with gr.Blocks(css='style.css') as demo:
68
  with gr.TabItem('Test'):
69
  create_inference_demo(pipe, HF_TOKEN)
70
  with gr.TabItem('Upload'):
 
 
 
71
  create_upload_demo(HF_TOKEN)
72
 
73
  demo.queue(max_size=1).launch(share=False)
 
68
  with gr.TabItem('Test'):
69
  create_inference_demo(pipe, HF_TOKEN)
70
  with gr.TabItem('Upload'):
71
+ gr.Markdown('''
72
+ - You can use this tab to upload models later if you choose not to upload models in training time or if upload in training time failed.
73
+ ''')
74
  create_upload_demo(HF_TOKEN)
75
 
76
  demo.queue(max_size=1).launch(share=False)
app_training.py CHANGED
@@ -40,14 +40,19 @@ def create_training_demo(trainer: Trainer,
40
  label='Upload model to Hub',
41
  value=bool(os.getenv('SPACE_ID')))
42
  use_private_repo = gr.Checkbox(label='Private',
43
- value=False)
44
  delete_existing_repo = gr.Checkbox(
45
  label='Delete existing repo of the same name',
46
  value=False)
47
  upload_to = gr.Radio(
48
  label='Upload to',
49
  choices=[_.value for _ in UploadTarget],
50
- value=UploadTarget.PERSONAL_PROFILE.value)
 
 
 
 
 
51
 
52
  with gr.Box():
53
  gr.Markdown('Training Parameters')
 
40
  label='Upload model to Hub',
41
  value=bool(os.getenv('SPACE_ID')))
42
  use_private_repo = gr.Checkbox(label='Private',
43
+ value=True)
44
  delete_existing_repo = gr.Checkbox(
45
  label='Delete existing repo of the same name',
46
  value=False)
47
  upload_to = gr.Radio(
48
  label='Upload to',
49
  choices=[_.value for _ in UploadTarget],
50
+ value=UploadTarget.LORA_LIBRARY.value)
51
+ gr.Markdown('''
52
+ - By default, trained models will be uploaded to [LoRA Library](https://huggingface.co/lora-library) (See [this example model](https://huggingface.co/lora-library/lora-dreambooth-sample-dog)).
53
+ Note that it will fail if you are not a member of the organization. So please join the org first. In the case uploading failed, you can use the "Upload" tab to upload your model later.
54
+ - You can also choose "Personal Profile", in which case, the model will be uploaded to https://huggingface.co/{your_username}/{model_name}.
55
+ ''')
56
 
57
  with gr.Box():
58
  gr.Markdown('Training Parameters')
app_upload.py CHANGED
@@ -58,17 +58,15 @@ def create_upload_demo(hf_token: str | None) -> gr.Blocks:
58
  label='Model names',
59
  choices=model_dirs,
60
  value=model_dirs[0] if model_dirs else None)
61
- gr.Markdown(
62
- '- Models uploaded in training time will not be shown here.')
63
  with gr.Box():
64
  gr.Markdown('Upload Settings')
65
  with gr.Row():
66
- use_private_repo = gr.Checkbox(label='Private', value=False)
67
  delete_existing_repo = gr.Checkbox(
68
  label='Delete existing repo of the same name', value=False)
69
  upload_to = gr.Radio(label='Upload to',
70
  choices=[_.value for _ in UploadTarget],
71
- value=UploadTarget.PERSONAL_PROFILE.value)
72
  model_name = gr.Textbox(label='Model Name')
73
  upload_button = gr.Button('Upload')
74
  gr.Markdown('''
 
58
  label='Model names',
59
  choices=model_dirs,
60
  value=model_dirs[0] if model_dirs else None)
 
 
61
  with gr.Box():
62
  gr.Markdown('Upload Settings')
63
  with gr.Row():
64
+ use_private_repo = gr.Checkbox(label='Private', value=True)
65
  delete_existing_repo = gr.Checkbox(
66
  label='Delete existing repo of the same name', value=False)
67
  upload_to = gr.Radio(label='Upload to',
68
  choices=[_.value for _ in UploadTarget],
69
+ value=UploadTarget.LORA_LIBRARY.value)
70
  model_name = gr.Textbox(label='Model Name')
71
  upload_button = gr.Button('Upload')
72
  gr.Markdown('''