Paul Dufour commited on
Commit
ab1f0c5
1 Parent(s): ee4ce56

Update demo

Browse files
Files changed (2) hide show
  1. index.html +1 -1
  2. index.js +2 -0
index.html CHANGED
@@ -31,7 +31,7 @@
31
  </select>
32
  <button id="load-model" type="button">Load Model</button>
33
  </div>
34
- <label id="container" for="upload">
35
  <div id="thumb">
36
  <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
37
  <path fill="#000" d="M3.5 24.3a3 3 0 0 1-1.9-.8c-.5-.5-.8-1.2-.8-1.9V2.9c0-.7.3-1.3.8-1.9.6-.5 1.2-.7 2-.7h18.6c.7 0 1.3.2 1.9.7.5.6.7 1.2.7 2v18.6c0 .7-.2 1.4-.7 1.9a3 3 0 0 1-2 .8H3.6Zm0-2.7h18.7V2.9H3.5v18.7Zm2.7-2.7h13.3c.3 0 .5 0 .6-.3v-.7l-3.7-5a.6.6 0 0 0-.6-.2c-.2 0-.4 0-.5.3l-3.5 4.6-2.4-3.3a.6.6 0 0 0-.6-.3c-.2 0-.4.1-.5.3l-2.7 3.6c-.1.2-.2.4 0 .7.1.2.3.3.6.3Z"></path>
 
31
  </select>
32
  <button id="load-model" type="button">Load Model</button>
33
  </div>
34
+ <label id="container" class="disabled" for="upload">
35
  <div id="thumb">
36
  <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
37
  <path fill="#000" d="M3.5 24.3a3 3 0 0 1-1.9-.8c-.5-.5-.8-1.2-.8-1.9V2.9c0-.7.3-1.3.8-1.9.6-.5 1.2-.7 2-.7h18.6c.7 0 1.3.2 1.9.7.5.6.7 1.2.7 2v18.6c0 .7-.2 1.4-.7 1.9a3 3 0 0 1-2 .8H3.6Zm0-2.7h18.7V2.9H3.5v18.7Zm2.7-2.7h13.3c.3 0 .5 0 .6-.3v-.7l-3.7-5a.6.6 0 0 0-.6-.2c-.2 0-.4 0-.5.3l-3.5 4.6-2.4-3.3a.6.6 0 0 0-.6-.3c-.2 0-.4.1-.5.3l-2.7 3.6c-.1.2-.2.4 0 .7.1.2.3.3.6.3Z"></path>
index.js CHANGED
@@ -31,6 +31,8 @@ async function initializeSessions() {
31
  if (dtype) {
32
  options.dtype = dtype;
33
  }
 
 
34
  model = await Qwen2VLForConditionalGeneration.from_pretrained(model_id, options);
35
 
36
  loadModelButton.textContent = 'Model Ready';
 
31
  if (dtype) {
32
  options.dtype = dtype;
33
  }
34
+ options['transformers.js_config'] = {};
35
+ options['transformers.js_config']['kv_cache_dtype'] = 'float16';
36
  model = await Qwen2VLForConditionalGeneration.from_pretrained(model_id, options);
37
 
38
  loadModelButton.textContent = 'Model Ready';