Spaces:
Running
Running
feat: Add sequential token prediction and placeholder options
Browse files- Implement sequential unmasking using previous predictions
- Add configurable placeholder options for unpredicted masks
- Add completed sentence display after prediction
- Improve UI with prediction set grouping and mask information
- Add inference text display for each mask
- Add toggle for sequential/parallel prediction mode
- assets/index-BRtc5ksz.js +0 -0
- assets/index-BuZR9Kir.css +1 -0
- assets/index-C66aksif.js +0 -0
- assets/index-CF8Yv3Jz.css +0 -1
- assets/{worker_mlm-C-nr7ZZ-.js → worker_mlm-7D3u1eME.js} +0 -0
- index.html +2 -2
assets/index-BRtc5ksz.js
DELETED
The diff for this file is too large to render.
See raw diff
|
|
assets/index-BuZR9Kir.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}#root{max-width:1280px;margin:0 auto;padding:2rem;text-align:center}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.card{padding:1.5rem;border-radius:8px;background:#f8f8f8;box-shadow:0 2px 4px #0000001a;width:100%;box-sizing:border-box}.read-the-docs{color:#888}.message{margin:1em 0;padding:.5em;background:#f0f0f0;border-radius:4px}.error{margin:1em 0;padding:.5em;background:#fff0f0;color:#c00;border-radius:4px}.container{max-width:900px;margin:0 auto;padding:1rem}textarea{width:100%;padding:.8em;margin-bottom:.5em;border:1px solid #ccc;border-radius:4px;font-size:1em;resize:vertical}button{background:#646cff;color:#fff;border:none;padding:.6em 1.2em;border-radius:4px;cursor:pointer;font-size:1em;margin:1em 0}button:hover{background:#747bff}button:disabled{opacity:.5;cursor:not-allowed}.predictions-container{margin:.5em 0;padding:.5em;background:#f0f0f0;border-radius:4px}.predictions-scroll{display:flex;overflow-x:auto;gap:.5em;padding:.5em;scrollbar-width:thin;scrollbar-color:#888 #eee}.predictions-scroll::-webkit-scrollbar{height:6px}.predictions-scroll::-webkit-scrollbar-track{background:#eee;border-radius:3px}.predictions-scroll::-webkit-scrollbar-thumb{background-color:#888;border-radius:3px}.prediction-item{background:#fff;padding:.5em 1em;border-radius:4px;box-shadow:0 1px 2px #0000001a;white-space:nowrap;font-size:.9em}.usage-hint{font-size:.8em;color:#888;margin:.2em 0 .5em;text-align:left;font-style:italic}.model-section{margin-top:1.5rem;padding:1rem;border:1px solid #e9ecef;border-radius:8px;background:#fff}.model-section h3{margin:0 0 .5rem;color:#666;font-size:1rem}.model-selector{display:grid;grid-template-columns:2fr 1fr 1fr auto;gap:.5rem;align-items:center}.model-selector select{padding:.4rem;border:1px solid #ccc;border-radius:4px;font-size:.9em;height:36px;background:#fff}.model-selector select:first-child{font-size:.85em}.device-select{width:auto;min-width:120px;padding:.6em 2.4em .6em 1.2em;border:1px solid #ccc;border-radius:4px;font-size:1em;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right .6em center;background-size:1.4em}.device-select:focus{outline:none;border-color:#646cff;box-shadow:0 0 0 2px #646cff33}.benchmark-info{font-size:.8em;color:#666;text-align:right;margin:.3rem 0}.quantization-select{width:auto;min-width:180px;padding:.6em 2.4em .6em 1.2em;border:1px solid #ccc;border-radius:4px;font-size:1em;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right .6em center;background-size:1.4em}.quantization-select:focus{outline:none;border-color:#646cff;box-shadow:0 0 0 2px #646cff33}.notifications-container{position:fixed;top:20px;right:20px;z-index:1000;display:flex;flex-direction:column;gap:10px}.notification{padding:12px 24px;border-radius:4px;color:#fff;font-size:.9em;max-width:300px;animation:slideIn .3s ease-out,fadeOut .3s ease-in forwards 2.7s;box-shadow:0 2px 5px #0003}.notification-info{background-color:#3498db}.notification-warning{background-color:#f1c40f;color:#2c3e50}.notification-error{background-color:#e74c3c}@keyframes slideIn{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.all-predictions-container{display:flex;flex-direction:column;gap:1rem;max-height:none;padding:.5rem}.predictions-container{border:1px solid #ddd;border-radius:8px;padding:.5rem;background:#f8f9fa}.mask-label{font-weight:700;margin-bottom:.5rem;color:#666}.predictions-scroll{display:flex;flex-direction:column;gap:.5rem}.prediction-item{padding:.5rem;background:#fff;border-radius:4px;border:1px solid #eee}.predictions-scroll.horizontal{display:flex;flex-direction:row;overflow-x:auto;overflow-y:hidden;padding:.3rem;gap:.5rem}.prediction-item{padding:.5rem 1rem;background:#fff;border-radius:4px;border:1px solid #eee;white-space:nowrap}.mask-info{font-weight:400;font-size:.9em;color:#888;margin-left:.5rem}.sequential-option{text-align:left;margin:.5rem 0;color:#666}.sequential-option label{display:flex;align-items:center;gap:.5rem;cursor:pointer}.sequential-option input[type=checkbox]{margin:0;cursor:pointer}.inference-text{margin-top:.5rem;padding:.5rem;background:#f0f0f0;border-radius:4px;font-family:monospace;font-size:.9em;color:#666;text-align:left}.spare-placeholder-option{text-align:left;margin:1rem 0;color:#666;display:flex;align-items:center;gap:1rem}.spare-placeholder-option select{padding:.3rem;border:1px solid #ccc;border-radius:4px;background:#fff}.custom-placeholder-input{padding:.3rem;border:1px solid #ccc;border-radius:4px;width:150px}.input-section{margin-bottom:1rem}.input-footer{display:flex;justify-content:space-between;align-items:center;margin-top:.5rem}.usage-hint{font-size:.8em;color:#888;text-align:left;font-style:italic;flex:1}.unmask-button{margin:0;min-width:100px}.completed-sentence{margin:.8rem 0;padding:.6rem .8rem;background:#f8f9fa;border:1px solid #e9ecef;border-radius:4px;text-align:left;font-size:1em;line-height:1.4}.completed-label{color:#666;font-weight:700;margin-right:.5rem}.completed-text{color:#212529}.model-load-time{font-size:.8em;color:#666;margin-top:.3rem}@media (max-width: 768px){.model-selector{grid-template-columns:1fr;gap:.5rem}.spare-placeholder-option{grid-template-columns:1fr}.container{padding:.5rem}.card{padding:1rem}}.load-button{font-size:.9em;padding:.4rem 1rem;white-space:nowrap;height:36px}
|
assets/index-C66aksif.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
assets/index-CF8Yv3Jz.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}#root{max-width:1280px;margin:0 auto;padding:2rem;text-align:center}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.card{padding:2em;border-radius:8px;background:#f8f8f8;box-shadow:0 2px 4px #0000001a;max-width:800px;margin:0 auto}.read-the-docs{color:#888}.message{margin:1em 0;padding:.5em;background:#f0f0f0;border-radius:4px}.error{margin:1em 0;padding:.5em;background:#fff0f0;color:#c00;border-radius:4px}.container{max-width:800px;margin:0 auto;padding:2rem;text-align:center}textarea{width:100%;padding:.8em;margin-bottom:.5em;border:1px solid #ccc;border-radius:4px;font-size:1em;resize:vertical}button{background:#646cff;color:#fff;border:none;padding:.6em 1.2em;border-radius:4px;cursor:pointer;font-size:1em;margin:1em 0}button:hover{background:#747bff}button:disabled{opacity:.5;cursor:not-allowed}.predictions-container{margin:.5em 0;padding:.5em;background:#f0f0f0;border-radius:4px}.predictions-scroll{display:flex;overflow-x:auto;gap:.5em;padding:.5em;scrollbar-width:thin;scrollbar-color:#888 #eee}.predictions-scroll::-webkit-scrollbar{height:6px}.predictions-scroll::-webkit-scrollbar-track{background:#eee;border-radius:3px}.predictions-scroll::-webkit-scrollbar-thumb{background-color:#888;border-radius:3px}.prediction-item{background:#fff;padding:.5em 1em;border-radius:4px;box-shadow:0 1px 2px #0000001a;white-space:nowrap;font-size:.9em}.usage-hint{font-size:.8em;color:#888;margin:.2em 0 .5em;text-align:left;font-style:italic}.model-section{margin-top:2em;padding-top:1em;border-top:1px solid #eee}.model-section h3{margin:0 0 1em;color:#666;font-size:1.1em}.model-selector{margin-bottom:.5em;display:flex;gap:1em;align-items:stretch}.model-selector select{flex:1;padding:.6em 2.4em .6em 1.2em;border:1px solid #ccc;border-radius:4px;font-size:1em;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right .6em center;background-size:1.4em}.model-selector select:focus{outline:none;border-color:#646cff;box-shadow:0 0 0 2px #646cff33}.model-selector button{margin:0;white-space:nowrap}.device-select{width:auto;min-width:120px;padding:.6em 2.4em .6em 1.2em;border:1px solid #ccc;border-radius:4px;font-size:1em;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right .6em center;background-size:1.4em}.device-select:focus{outline:none;border-color:#646cff;box-shadow:0 0 0 2px #646cff33}.benchmark-info{font-size:.8em;color:#666;text-align:right;margin:.2em 0 1em}.quantization-select{width:auto;min-width:180px;padding:.6em 2.4em .6em 1.2em;border:1px solid #ccc;border-radius:4px;font-size:1em;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right .6em center;background-size:1.4em}.quantization-select:focus{outline:none;border-color:#646cff;box-shadow:0 0 0 2px #646cff33}.notifications-container{position:fixed;top:20px;right:20px;z-index:1000;display:flex;flex-direction:column;gap:10px}.notification{padding:12px 24px;border-radius:4px;color:#fff;font-size:.9em;max-width:300px;animation:slideIn .3s ease-out,fadeOut .3s ease-in forwards 2.7s;box-shadow:0 2px 5px #0003}.notification-info{background-color:#3498db}.notification-warning{background-color:#f1c40f;color:#2c3e50}.notification-error{background-color:#e74c3c}@keyframes slideIn{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}
|
|
|
|
assets/{worker_mlm-C-nr7ZZ-.js → worker_mlm-7D3u1eME.js}
RENAMED
The diff for this file is too large to render.
See raw diff
|
|
index.html
CHANGED
@@ -5,8 +5,8 @@
|
|
5 |
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
7 |
<title>FillMask-JS Demo</title>
|
8 |
-
<script type="module" crossorigin src="/assets/index-
|
9 |
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
10 |
</head>
|
11 |
<body>
|
12 |
<div id="root"></div>
|
|
|
5 |
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
7 |
<title>FillMask-JS Demo</title>
|
8 |
+
<script type="module" crossorigin src="/assets/index-C66aksif.js"></script>
|
9 |
+
<link rel="stylesheet" crossorigin href="/assets/index-BuZR9Kir.css">
|
10 |
</head>
|
11 |
<body>
|
12 |
<div id="root"></div>
|