AdaptorWorker
QuantizationLLMAdaptor
This is the adaptor for the Quantization LLM model
Source code in Agent/modules/quantization_llm/adaptor_worker.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
create_chat_completion(prompt=None, messages=None, tools=None, tool_choice=None, *args, **kwargs)
Create chat completion for the given prompt and messages Args: prompt (str): The prompt to generate completion for the model messages (List[Dict[str, str]]): The messages to generate completion for the model tools (List[ChatCompletionTool]): The tools to use for chat completion tool_choice (ChatCompletionToolChoiceOption): The tool choice to use for chat completion args: *kwargs:
Returns:
Source code in Agent/modules/quantization_llm/adaptor_worker.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
create_completion(prompt)
Create completion for the given prompt Args: prompt (str): The prompt to generate completion for the model
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The completion generated by the model |
Source code in Agent/modules/quantization_llm/adaptor_worker.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
create_embedding(text)
Create embedding for the given text Args: text (str): The text to generate embedding for
Returns:
Type | Description |
---|---|
List[float]
|
List[float]: The embedding generated by the model |
Source code in Agent/modules/quantization_llm/adaptor_worker.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|