m4singer commited on
Commit
9ca6447
1 Parent(s): be26457

Add sharing function

Browse files
inference/m4singer/gradio/share_btn.py CHANGED
@@ -44,9 +44,9 @@ share_js = """async () => {
44
 
45
  const outputMusic_name = outputMusic_src.split('/').pop();
46
  let titleTxt = outputMusic_name;
47
- //if(titleTxt.length > 100){
48
- // titleTxt = titleTxt.slice(0, 100) + ' ...';
49
- //}
50
  const shareBtnEl = gradioEl.querySelector('#share-btn');
51
  const shareIconEl = gradioEl.querySelector('#share-btn-share-icon');
52
  const loadingIconEl = gradioEl.querySelector('#share-btn-loading-icon');
 
44
 
45
  const outputMusic_name = outputMusic_src.split('/').pop();
46
  let titleTxt = outputMusic_name;
47
+ if(titleTxt.length > 30){
48
+ titleTxt = 'demo';
49
+ }
50
  const shareBtnEl = gradioEl.querySelector('#share-btn');
51
  const shareIconEl = gradioEl.querySelector('#share-btn-share-icon');
52
  const loadingIconEl = gradioEl.querySelector('#share-btn-loading-icon');