You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✨ [Widgets] Enable streaming in the conversational widget (#486)
Linked to #360#410
Should unlock the conversational widget on Mistral if I'm not mistaken?
# TL;DR
- Leverage inference types from `@huggingface/task` to type input and
output of the inference client
- Use the inference client to call the inference serverless API
- Use the streaming API when supported for the model
---------
Co-authored-by: Mishig <mishig.davaadorj@coloradocollege.edu>
Co-authored-by: Victor Mustar <victor.mustar@gmail.com>
* (Optional: True). Bool. Whether or not to use sampling, use greedy decoding otherwise.
13
-
*/
14
-
do_sample?: boolean;
15
-
/**
16
-
* (Default: None). Int (0-250). The amount of new tokens to be generated, this does not include the input length it is a estimate of the size of generated text you want. Each new tokens slows down the request, so look for balance between response times and length of text generated.
17
-
*/
18
-
max_new_tokens?: number;
19
-
/**
20
-
* (Default: None). Float (0-120.0). The amount of time in seconds that the query should take maximum. Network can cause some overhead so it will be a soft limit. Use that in combination with max_new_tokens for best results.
21
-
*/
22
-
max_time?: number;
23
-
/**
24
-
* (Default: 1). Integer. The number of proposition you want to be returned.
25
-
*/
26
-
num_return_sequences?: number;
27
-
/**
28
-
* (Default: None). Float (0.0-100.0). The more a token is used within generation the more it is penalized to not be picked in successive generation passes.
29
-
*/
30
-
repetition_penalty?: number;
31
-
/**
32
-
* (Default: True). Bool. If set to False, the return results will not contain the original query making it easier for prompting.
33
-
*/
34
-
return_full_text?: boolean;
35
-
/**
36
-
* (Default: 1.0). Float (0.0-100.0). The temperature of the sampling operation. 1 means regular sampling, 0 means always take the highest score, 100.0 is getting closer to uniform probability.
37
-
*/
38
-
temperature?: number;
39
-
/**
40
-
* (Default: None). Integer to define the top tokens considered within the sample operation to create new text.
41
-
*/
42
-
top_k?: number;
43
-
/**
44
-
* (Default: None). Float to define the tokens that are within the sample operation of text generation. Add tokens in the sample for more probable to least probable until the sum of the probabilities is greater than top_p.
45
-
*/
46
-
top_p?: number;
47
-
/**
48
-
* (Default: None). Integer. The maximum number of tokens from the input.
49
-
*/
50
-
truncate?: number;
51
-
/**
52
-
* (Default: []) List of strings. The model will stop generating text when one of the strings in the list is generated.
53
-
* **/
54
-
stop_sequences?: string[];
55
-
};
56
-
};
57
-
58
-
exportinterfaceTextGenerationOutput{
59
-
/**
60
-
* The continuated string
61
-
*/
62
-
generated_text: string;
63
-
}
64
-
65
6
/**
66
7
* Use to continue text from a prompt. This is a very generic task. Recommended model: gpt2 (it’s a simple model, but fun to play with).
0 commit comments