Spaces:
Sleeping
Sleeping
Update assets/index-Btti6dN2.js
Browse files- assets/index-Btti6dN2.js +0 -82
assets/index-Btti6dN2.js
CHANGED
|
@@ -31,89 +31,7 @@ var pp=Object.defineProperty;var hp=(d,s,o)=>s in d?pp(d,s,{enumerable:!0,config
|
|
| 31 |
* This source code is licensed under the MIT license found in the
|
| 32 |
* LICENSE file in the root directory of this source tree.
|
| 33 |
*/var Vc;
|
| 34 |
-
// Tableaux pour stocker les données du graphique
|
| 35 |
-
let tokenLabels = []; // Exemple : [1, 2, 3, 4, 5...] (Index du token)
|
| 36 |
-
let tpsData = []; // Exemple : [45, 62, 68, 69...] (Vitesse à ce moment-là)
|
| 37 |
|
| 38 |
-
myWorker.onmessage = function(e) {
|
| 39 |
-
const { status, tps, numTokens, output } = e.data;
|
| 40 |
-
|
| 41 |
-
if (status === 'start') {
|
| 42 |
-
// Réinitialiser les données au début d'une nouvelle génération
|
| 43 |
-
tokenLabels = [];
|
| 44 |
-
tpsData = [];
|
| 45 |
-
// Optionnel : Réinitialiser le graphique ici
|
| 46 |
-
}
|
| 47 |
-
|
| 48 |
-
if (status === 'update' && tps) {
|
| 49 |
-
// On ajoute le numéro du token actuel et la vitesse reçue
|
| 50 |
-
tokenLabels.push(numTokens);
|
| 51 |
-
tpsData.push(parseFloat(tps.toFixed(2))); // Arrondi à 2 décimales
|
| 52 |
-
|
| 53 |
-
// Mettre à jour le graphique (voir Étape 2)
|
| 54 |
-
updateStressTestChart(tokenLabels, tpsData);
|
| 55 |
-
}
|
| 56 |
-
|
| 57 |
-
if (status === 'complete') {
|
| 58 |
-
console.log("Génération terminée !");
|
| 59 |
-
}
|
| 60 |
-
};
|
| 61 |
-
const ctx = document.getElementById('stressTestChart').getContext('2d');
|
| 62 |
-
let stressChart;
|
| 63 |
-
|
| 64 |
-
// Fonction pour initialiser ou rafraîchir le graphique
|
| 65 |
-
function updateStressTestChart(labels, data) {
|
| 66 |
-
if (stressChart) {
|
| 67 |
-
// Si le graphique existe déjà, on met simplement à jour ses données
|
| 68 |
-
stressChart.data.labels = labels;
|
| 69 |
-
stressChart.data.datasets[0].data = data;
|
| 70 |
-
stressChart.update('none'); // 'none' pour désactiver l'animation de transition et gagner en performance pendant le stream
|
| 71 |
-
} else {
|
| 72 |
-
// Création initiale du graphique
|
| 73 |
-
stressChart = new Chart(ctx, {
|
| 74 |
-
type: 'line',
|
| 75 |
-
data: {
|
| 76 |
-
labels: labels,
|
| 77 |
-
datasets: [{
|
| 78 |
-
label: 'Vitesse de génération (Tokens/Sec)',
|
| 79 |
-
data: data,
|
| 80 |
-
borderColor: 'rgb(75, 192, 192)',
|
| 81 |
-
backgroundColor: 'rgba(75, 192, 192, 0.1)',
|
| 82 |
-
borderWidth: 2,
|
| 83 |
-
tension: 0.2, // Légère courbe pour le rendu visuel
|
| 84 |
-
pointRadius: 0 // Cache les points individuels pour optimiser les performances si beaucoup de tokens
|
| 85 |
-
}]
|
| 86 |
-
},
|
| 87 |
-
options: {
|
| 88 |
-
responsive: true,
|
| 89 |
-
scales: {
|
| 90 |
-
x: {
|
| 91 |
-
title: {
|
| 92 |
-
display: true,
|
| 93 |
-
text: 'Nombre de Tokens Générés'
|
| 94 |
-
}
|
| 95 |
-
},
|
| 96 |
-
y: {
|
| 97 |
-
beginAtZero: true,
|
| 98 |
-
title: {
|
| 99 |
-
display: true,
|
| 100 |
-
text: 'Tokens / Seconde'
|
| 101 |
-
}
|
| 102 |
-
}
|
| 103 |
-
},
|
| 104 |
-
plugins: {
|
| 105 |
-
legend: {
|
| 106 |
-
position: 'top',
|
| 107 |
-
},
|
| 108 |
-
title: {
|
| 109 |
-
display: true,
|
| 110 |
-
text: 'Performances WebGPU en Temps Réel'
|
| 111 |
-
}
|
| 112 |
-
}
|
| 113 |
-
}
|
| 114 |
-
});
|
| 115 |
-
}
|
| 116 |
-
}
|
| 117 |
function xp(){if(Vc)return mt;Vc=1;var d=ou(),s=wp();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,f={};function p(e,t){y(e,t),y(e+"Capture",t)}function y(e,t){for(f[e]=t,e=0;e<t.length;e++)a.add(t[e])}var k=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_=Object.prototype.hasOwnProperty,T=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,S={},O={};function M(e){return _.call(O,e)?!0:_.call(S,e)?!1:T.test(e)?O[e]=!0:(S[e]=!0,!1)}function D(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function G(e,t,n,r){if(t===null||typeof t>"u"||D(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function j(e,t,n,r,l,i,u){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=u}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new j(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];b[t]=new j(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new j(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new j(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new j(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new j(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new j(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new j(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new j(e,5,!1,e.toLowerCase(),null,!1,!1)});var ce=/[\-:]([a-z])/g;function ye(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ce,ye);b[t]=new j(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ce,ye);b[t]=new j(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ce,ye);b[t]=new j(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new j(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new j(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ce(e,t,n,r){var l=b.hasOwnProperty(t)?b[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(G(t,n,l,r)&&(n=null),r||l===null?M(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ee=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,fe=Symbol.for("react.element"),te=Symbol.for("react.portal"),xe=Symbol.for("react.fragment"),de=Symbol.for("react.strict_mode"),wt=Symbol.for("react.profiler"),ne=Symbol.for("react.provider"),ue=Symbol.for("react.context"),_e=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),ze=Symbol.for("react.suspense_list"),ut=Symbol.for("react.memo"),We=Symbol.for("react.lazy"),Re=Symbol.for("react.offscreen"),I=Symbol.iterator;function K(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var F=Object.assign,v;function R(e){if(v===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);v=t&&t[1]||""}return`
|
| 118 |
`+v+e}var Y=!1;function re(e,t){if(!e||Y)return"";Y=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(E){var r=E}Reflect.construct(e,[],t)}else{try{t.call()}catch(E){r=E}e.call(t.prototype)}else{try{throw Error()}catch(E){r=E}e()}}catch(E){if(E&&r&&typeof E.stack=="string"){for(var l=E.stack.split(`
|
| 119 |
`),i=r.stack.split(`
|
|
|
|
| 31 |
* This source code is licensed under the MIT license found in the
|
| 32 |
* LICENSE file in the root directory of this source tree.
|
| 33 |
*/var Vc;
|
|
|
|
|
|
|
|
|
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
function xp(){if(Vc)return mt;Vc=1;var d=ou(),s=wp();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,f={};function p(e,t){y(e,t),y(e+"Capture",t)}function y(e,t){for(f[e]=t,e=0;e<t.length;e++)a.add(t[e])}var k=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_=Object.prototype.hasOwnProperty,T=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,S={},O={};function M(e){return _.call(O,e)?!0:_.call(S,e)?!1:T.test(e)?O[e]=!0:(S[e]=!0,!1)}function D(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function G(e,t,n,r){if(t===null||typeof t>"u"||D(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function j(e,t,n,r,l,i,u){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=u}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new j(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];b[t]=new j(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new j(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new j(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new j(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new j(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new j(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new j(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new j(e,5,!1,e.toLowerCase(),null,!1,!1)});var ce=/[\-:]([a-z])/g;function ye(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ce,ye);b[t]=new j(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ce,ye);b[t]=new j(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ce,ye);b[t]=new j(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new j(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new j(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ce(e,t,n,r){var l=b.hasOwnProperty(t)?b[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(G(t,n,l,r)&&(n=null),r||l===null?M(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ee=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,fe=Symbol.for("react.element"),te=Symbol.for("react.portal"),xe=Symbol.for("react.fragment"),de=Symbol.for("react.strict_mode"),wt=Symbol.for("react.profiler"),ne=Symbol.for("react.provider"),ue=Symbol.for("react.context"),_e=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),ze=Symbol.for("react.suspense_list"),ut=Symbol.for("react.memo"),We=Symbol.for("react.lazy"),Re=Symbol.for("react.offscreen"),I=Symbol.iterator;function K(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var F=Object.assign,v;function R(e){if(v===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);v=t&&t[1]||""}return`
|
| 36 |
`+v+e}var Y=!1;function re(e,t){if(!e||Y)return"";Y=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(E){var r=E}Reflect.construct(e,[],t)}else{try{t.call()}catch(E){r=E}e.call(t.prototype)}else{try{throw Error()}catch(E){r=E}e()}}catch(E){if(E&&r&&typeof E.stack=="string"){for(var l=E.stack.split(`
|
| 37 |
`),i=r.stack.split(`
|