Spaces:
Runtime error
Runtime error
Update share_btn.py
Browse files- share_btn.py +14 -9
share_btn.py
CHANGED
@@ -65,8 +65,9 @@ share_js = """async () => {
|
|
65 |
// const gradioEl = document.querySelector("gradio-app").shadowRoot;
|
66 |
const inputPromptEl = gradioEl.querySelector('#input-prompt input').value;
|
67 |
const outputVideoEl = gradioEl.querySelector('#output-video video');
|
68 |
-
|
69 |
-
|
|
|
70 |
|
71 |
let titleTxt = inputPromptEl;
|
72 |
//if(titleTxt.length > 100){
|
@@ -83,14 +84,18 @@ share_js = """async () => {
|
|
83 |
loadingIconEl.style.removeProperty('display');
|
84 |
const outputVideo = await getInputVideoFile(outputVideoEl);
|
85 |
const urlOutputVideo = await uploadFile(outputVideo);
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
|
91 |
-
const descriptionMd = `#### Here is my AI generated
|
92 |
-
|
93 |
-
|
|
|
|
|
|
|
|
|
94 |
`;
|
95 |
const params = new URLSearchParams({
|
96 |
title: titleTxt,
|
|
|
65 |
// const gradioEl = document.querySelector("gradio-app").shadowRoot;
|
66 |
const inputPromptEl = gradioEl.querySelector('#input-prompt input').value;
|
67 |
const outputVideoEl = gradioEl.querySelector('#output-video video');
|
68 |
+
const outputImgEl = gradioEl.querySelector('#output-img img');
|
69 |
+
const outputMusic = gradioEl.querySelector('#output-music audio');
|
70 |
+
const outputMusic_src = gradioEl.querySelector('#output-music audio').src;
|
71 |
|
72 |
let titleTxt = inputPromptEl;
|
73 |
//if(titleTxt.length > 100){
|
|
|
84 |
loadingIconEl.style.removeProperty('display');
|
85 |
const outputVideo = await getInputVideoFile(outputVideoEl);
|
86 |
const urlOutputVideo = await uploadFile(outputVideo);
|
87 |
+
const outputImg = await getInputImgFile(outputImgEl);
|
88 |
+
const urlOutputImg = await uploadFile(outputImg);
|
89 |
+
const musicFile = await getOutputMusicFile(outputMusic);
|
90 |
+
const dataOutputMusic = await uploadFile(musicFile);
|
91 |
|
92 |
+
const descriptionMd = `#### Here is my AI generated art & music:
|
93 |
+
<img src='${urlOutputImg}' style='max-height: 512px;'>
|
94 |
+
|
95 |
+
<audio controls>
|
96 |
+
<source src="${dataOutputMusic}" type="audio/wav">
|
97 |
+
Your browser does not support the audio element.
|
98 |
+
</audio>
|
99 |
`;
|
100 |
const params = new URLSearchParams({
|
101 |
title: titleTxt,
|