Replies: 1 comment
-
🤖 Hi there, It seems like you're trying to create a LlamaCpp object from a string representation. However, using To better assist you, could you provide more context about your use case? Specifically, it would be helpful to know:
With more information, I can provide a more accurate solution to your problem. This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a custom callback handler, for LlamaCpp.
With on_llm_start(self, serialized: Dict[str, Any], prompts: List[str], **kwargs: Any) I can access a text representation of the current LlamaCpp object,
{'serialized': {'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'llms', 'llamacpp', 'LlamaCpp'], 'repr': "LlamaCpp(cache=None, verbose=True, callbacks=<langchain.callbacks.manager.CallbackManager object at 0x7fb08df7ef50>, tags=None, metadata=None, client=<llama_cpp.llama.Llama object at 0x7fb08df7fb80>, model_path='/root/.cache/huggingface/hub/models--TheBloke--Llama-2-13B-chat-GGUF/snapshots/4458acc949de0a9914c3eab623904d4fe999050a/llama-2-13b-chat.Q4_K_M.gguf', lora_base=None, lora_path=None, n_ctx=2500, n_parts=-1, seed=-1, f16_kv=True, logits_all=False, vocab_only=False, use_mlock=False, n_threads=None, n_batch=512, n_gpu_layers=32, suffix=None, max_tokens=2500, temperature=0.8, top_p=0.95, logprobs=None, echo=False, stop=[], repeat_penalty=1.1, top_k=40, last_n_tokens_size=64, use_mmap=True, rope_freq_scale=1.0, rope_freq_base=10000.0, model_kwargs={}, streaming=True, grammar_path=None, grammar=None)"},
eval(serialized['repr']) throws a SyntaxError, is there a way that I could use the same object (to count tokens) or should I create a new one from these args?
Beta Was this translation helpful? Give feedback.
All reactions