Open Rubyer77 opened 8 months ago
I have encountered the same issue. I downloaded phi-2.Q4_K_M.gguf according to the instructions in the documentation, but I get ValueError: only one element tensors can be converted to Python scalars.
I patched the code to bypass this error (ran into a second). FYI
def decode(self, token_ids: NDArray[np.int64]) -> List[str]:
+ if isinstance(token_ids, torch.Tensor):
+ token_ids = token_ids.numpy()
if isinstance(token_ids, list):
token_ids = np.array(token_ids)
if token_ids.ndim == 1:
token_ids = [token_ids]
I patched the code to bypass this error (ran into a second). FYI
def decode(self, token_ids: NDArray[np.int64]) -> List[str]: + if isinstance(token_ids, torch.Tensor): + token_ids = token_ids.numpy() if isinstance(token_ids, list): token_ids = np.array(token_ids) if token_ids.ndim == 1: token_ids = [token_ids]
error is still present for me with that patch
https://github.com/outlines-dev/outlines/pull/548 seems to help 🤗
Describe the issue as clearly as possible:
I run
examples/llamacpp_example.py
output of
poetry show
:Steps/code to reproduce the bug:
Expected result:
Error message:
No response
Outlines/Python version information:
Context for the issue:
No response