tgi.js 481 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { get_options, run } from "./common.js";
 
const reference_latency_ms = 30;
const host = __ENV.HOST || '127.0.0.1:8000';
const max_new_tokens = 50;


function generate_payload(gpt){
    const input = gpt["conversations"][0]["value"];
    return {"inputs": input, "parameters": {"max_new_tokens": max_new_tokens, "temperature" : 0.5}}
}

export const options = get_options(reference_latency_ms);

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