Spaces:
Running
Running
coyotte508
commited on
Commit
·
124aade
1
Parent(s):
687447e
fix job id
Browse files
app.js
CHANGED
@@ -64,13 +64,13 @@ window.document.addEventListener("DOMContentLoaded", () => {
|
|
64 |
const result = await jobResponse.json();
|
65 |
|
66 |
if (!jobResponse.ok) {
|
67 |
-
output.textContent
|
68 |
return;
|
69 |
}
|
70 |
|
71 |
-
|
72 |
|
73 |
-
const jobId = result["
|
74 |
|
75 |
const eventSource = new EventSource(`https://huggingface.co/api/jobs/${jobId}/sse`, {
|
76 |
headers: {
|
|
|
64 |
const result = await jobResponse.json();
|
65 |
|
66 |
if (!jobResponse.ok) {
|
67 |
+
output.textContent += `Error: ${result.error}`;
|
68 |
return;
|
69 |
}
|
70 |
|
71 |
+
output.textContent += JSON.stringify(result, null, 2);
|
72 |
|
73 |
+
const jobId = result["metadata"]["job_id"];
|
74 |
|
75 |
const eventSource = new EventSource(`https://huggingface.co/api/jobs/${jobId}/sse`, {
|
76 |
headers: {
|