Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- assets/{index-BP17AIvh.js → index-Dv5Q2SHa.js} +0 -0
- index.html +1 -1
- src/hooks/useLLM.ts +3 -5
assets/{index-BP17AIvh.js → index-Dv5Q2SHa.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
/>
|
| 9 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 10 |
<title>Maincoder 1B - In-Browser Code Generation</title>
|
| 11 |
-
<script type="module" crossorigin src="/assets/index-
|
| 12 |
<link rel="stylesheet" crossorigin href="/assets/index-Co9424he.css">
|
| 13 |
</head>
|
| 14 |
<body>
|
|
|
|
| 8 |
/>
|
| 9 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 10 |
<title>Maincoder 1B - In-Browser Code Generation</title>
|
| 11 |
+
<script type="module" crossorigin src="/assets/index-Dv5Q2SHa.js"></script>
|
| 12 |
<link rel="stylesheet" crossorigin href="/assets/index-Co9424he.css">
|
| 13 |
</head>
|
| 14 |
<body>
|
src/hooks/useLLM.ts
CHANGED
|
@@ -130,7 +130,7 @@ export const useLLM = () => {
|
|
| 130 |
const streamer = onToken
|
| 131 |
? new TextStreamer(tokenizer, {
|
| 132 |
skip_prompt: true,
|
| 133 |
-
skip_special_tokens:
|
| 134 |
callback_function: onToken,
|
| 135 |
})
|
| 136 |
: undefined;
|
|
@@ -149,10 +149,8 @@ export const useLLM = () => {
|
|
| 149 |
|
| 150 |
const response = tokenizer
|
| 151 |
.batch_decode(sequences.slice(null, [input.input_ids.dims[1], null]), {
|
| 152 |
-
skip_special_tokens:
|
| 153 |
-
})[0]
|
| 154 |
-
.replace(/<\|end_of_text\|>$/, "")
|
| 155 |
-
.replace(/<\|im_end\|>$/, "");
|
| 156 |
|
| 157 |
return response;
|
| 158 |
},
|
|
|
|
| 130 |
const streamer = onToken
|
| 131 |
? new TextStreamer(tokenizer, {
|
| 132 |
skip_prompt: true,
|
| 133 |
+
skip_special_tokens: true,
|
| 134 |
callback_function: onToken,
|
| 135 |
})
|
| 136 |
: undefined;
|
|
|
|
| 149 |
|
| 150 |
const response = tokenizer
|
| 151 |
.batch_decode(sequences.slice(null, [input.input_ids.dims[1], null]), {
|
| 152 |
+
skip_special_tokens: true,
|
| 153 |
+
})[0];
|
|
|
|
|
|
|
| 154 |
|
| 155 |
return response;
|
| 156 |
},
|