Spaces:
Sleeping
Sleeping
Commit ·
fc5f1c3
1
Parent(s): ea92e9f
fix: added
Browse files
server.js
CHANGED
|
@@ -97,6 +97,7 @@ async function runTextInference(prompt, maxTokens) {
|
|
| 97 |
const output = await model.generate({
|
| 98 |
...inputs,
|
| 99 |
max_new_tokens: maxTokens,
|
|
|
|
| 100 |
});
|
| 101 |
|
| 102 |
const promptLength = inputs.input_ids.dims.at(-1);
|
|
@@ -284,6 +285,7 @@ app.post("/prompt", express.json(), async (req, res) => {
|
|
| 284 |
request_id: req.requestId,
|
| 285 |
duration_ms: Date.now() - start,
|
| 286 |
response_chars: response?.length ?? 0,
|
|
|
|
| 287 |
});
|
| 288 |
res.json({ response });
|
| 289 |
} catch (err) {
|
|
|
|
| 97 |
const output = await model.generate({
|
| 98 |
...inputs,
|
| 99 |
max_new_tokens: maxTokens,
|
| 100 |
+
do_sample: false,
|
| 101 |
});
|
| 102 |
|
| 103 |
const promptLength = inputs.input_ids.dims.at(-1);
|
|
|
|
| 285 |
request_id: req.requestId,
|
| 286 |
duration_ms: Date.now() - start,
|
| 287 |
response_chars: response?.length ?? 0,
|
| 288 |
+
model_output: response,
|
| 289 |
});
|
| 290 |
res.json({ response });
|
| 291 |
} catch (err) {
|