coyotte508 commited on
Commit
1ce79db
·
1 Parent(s): 0fe50fd

fix token use

Browse files
Files changed (1) hide show
  1. app.js +4 -4
app.js CHANGED
@@ -33,7 +33,7 @@ window.document.addEventListener("DOMContentLoaded", () => {
33
  const tokenOwnerResp = await fetch("https://huggingface.co/api/whoami-v2", {
34
  method: "GET",
35
  headers: {
36
- Authorization: `Bearer ${data.hfToken}`,
37
  },
38
  });
39
 
@@ -55,7 +55,7 @@ window.document.addEventListener("DOMContentLoaded", () => {
55
  method: "POST",
56
  headers: {
57
  "Content-Type": "application/json",
58
- Authorization: `Bearer ${data.hfToken}`,
59
  },
60
  body: JSON.stringify(data),
61
  });
@@ -73,7 +73,7 @@ window.document.addEventListener("DOMContentLoaded", () => {
73
 
74
  const eventSource = new EventSource(`https://huggingface.co/api/jobs/${jobId}/sse`, {
75
  headers: {
76
- Authorization: `Bearer ${data.hfToken}`,
77
  },
78
  });
79
 
@@ -83,7 +83,7 @@ window.document.addEventListener("DOMContentLoaded", () => {
83
 
84
  const logSource = new EventSource(`https://huggingface.co/api/jobs/${jobId}/logs-stream`, {
85
  headers: {
86
- Authorization: `Bearer ${data.hfToken}`,
87
  },
88
  });
89
 
 
33
  const tokenOwnerResp = await fetch("https://huggingface.co/api/whoami-v2", {
34
  method: "GET",
35
  headers: {
36
+ Authorization: `Bearer ${hfToken.value}`,
37
  },
38
  });
39
 
 
55
  method: "POST",
56
  headers: {
57
  "Content-Type": "application/json",
58
+ Authorization: `Bearer ${hfToken.value}`,
59
  },
60
  body: JSON.stringify(data),
61
  });
 
73
 
74
  const eventSource = new EventSource(`https://huggingface.co/api/jobs/${jobId}/sse`, {
75
  headers: {
76
+ Authorization: `Bearer ${hfToken.value}`,
77
  },
78
  });
79
 
 
83
 
84
  const logSource = new EventSource(`https://huggingface.co/api/jobs/${jobId}/logs-stream`, {
85
  headers: {
86
+ Authorization: `Bearer ${hfToken.value}`,
87
  },
88
  });
89