Spaces:
Running
Running
coyotte508
commited on
Commit
·
f575c9e
1
Parent(s):
49caea1
Use secrets
Browse files
app.js
CHANGED
|
@@ -23,10 +23,12 @@ window.document.addEventListener("DOMContentLoaded", () => {
|
|
| 23 |
environment: {
|
| 24 |
HF_SPACE_NAME: spaceName.value,
|
| 25 |
BUILD_COMMAND: buildCommand.value,
|
| 26 |
-
HF_TOKEN: hfToken.value,
|
| 27 |
// Remove filename
|
| 28 |
OUTPUT_PATH: outputPath.value.replace(/\/[^/]*$/, ""),
|
| 29 |
},
|
|
|
|
|
|
|
|
|
|
| 30 |
arguments: [],
|
| 31 |
command: ["/app/build.sh"],
|
| 32 |
flavor: "cpu-basic",
|
|
@@ -72,7 +74,7 @@ window.document.addEventListener("DOMContentLoaded", () => {
|
|
| 72 |
|
| 73 |
output.textContent += JSON.stringify(result, null, 2);
|
| 74 |
|
| 75 |
-
const jobId = result["metadata"]["
|
| 76 |
|
| 77 |
fetchEventSource(`https://huggingface.co/api/jobs/${tokenOwer}/${jobId}/sse`, {
|
| 78 |
onmessage: (event) => {
|
|
|
|
| 23 |
environment: {
|
| 24 |
HF_SPACE_NAME: spaceName.value,
|
| 25 |
BUILD_COMMAND: buildCommand.value,
|
|
|
|
| 26 |
// Remove filename
|
| 27 |
OUTPUT_PATH: outputPath.value.replace(/\/[^/]*$/, ""),
|
| 28 |
},
|
| 29 |
+
secrets: {
|
| 30 |
+
HF_TOKEN: hfToken.value,
|
| 31 |
+
},
|
| 32 |
arguments: [],
|
| 33 |
command: ["/app/build.sh"],
|
| 34 |
flavor: "cpu-basic",
|
|
|
|
| 74 |
|
| 75 |
output.textContent += JSON.stringify(result, null, 2);
|
| 76 |
|
| 77 |
+
const jobId = result["metadata"]["jobId"];
|
| 78 |
|
| 79 |
fetchEventSource(`https://huggingface.co/api/jobs/${tokenOwer}/${jobId}/sse`, {
|
| 80 |
onmessage: (event) => {
|