tgi.js 490 Bytes
Newer Older
1
import { get_options, run } from "./common.js";
OlivierDehaene's avatar
OlivierDehaene committed
2

Nicolas Patry's avatar
Nicolas Patry committed
3
const reference_latency_ms = 70;
4
5
6
7
8
9
const host = __ENV.HOST || '127.0.0.1:8000';
const max_new_tokens = 50;


function generate_payload(gpt){
    const input = gpt["conversations"][0]["value"];
Nicolas Patry's avatar
Nicolas Patry committed
10
    return {"inputs": input, "parameters": {"max_new_tokens": max_new_tokens, "decoder_input_details": true}}
11
12
13
14
15
16
17
}

export const options = get_options(reference_latency_ms);

export default function(){
    run(host, generate_payload, max_new_tokens);
}