Merge pull request #4497 from NghiVo21/fix-vllm-setup
Fix vllm setup, json.data is an array and is accessed as such. Also a…
This commit is contained in:
commit
338ba83aa4
1 changed files with 5 additions and 2 deletions
|
|
@ -6,7 +6,10 @@ class Vllm extends OpenAI {
|
|||
static providerName = "vllm";
|
||||
constructor(options: LLMOptions) {
|
||||
super(options);
|
||||
this._setupCompletionOptions();
|
||||
|
||||
if (options.model === "AUTODETECT") {
|
||||
this._setupCompletionOptions();
|
||||
}
|
||||
}
|
||||
|
||||
private _setupCompletionOptions() {
|
||||
|
|
@ -22,7 +25,7 @@ class Vllm extends OpenAI {
|
|||
return;
|
||||
}
|
||||
const json = await response.json();
|
||||
const data = json.data;
|
||||
const data = json.data[0];
|
||||
this.model = data.id;
|
||||
this.contextLength = Number.parseInt(data.max_model_len);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue