Skip to content

ValueError: 0 unrecognized or not available. #3

Description

@firmai

Great project btw, really love the idea, have you been working on similar projects in the meantime?


ValueError Traceback (most recent call last)

in <cell line: 1>()
----> 1 cc = CausalChain(chunks)
2 cc.create_connections()
3 biggest_chain = cc.biggest_chain
4 cc.visualize(biggest_chain)

3 frames

/usr/local/lib/python3.10/dist-packages/causal_chains/CausalChain.py in init(self, chunks, device)
29 class CausalChain:
30 def init(self,chunks=[], device="cpu"):
---> 31 self.summarizer = pipeline("summarization", model="taskload/bart-cause-effect", device=0)
32 self.embmodel = SentenceTransformer('sentence-transformers/all-mpnet-base-v1').to(device)
33 self.chunks = chunks

/usr/local/lib/python3.10/dist-packages/transformers/pipelines/init.py in pipeline(task, model, config, tokenizer, feature_extractor, image_processor, framework, revision, use_fast, token, device, device_map, torch_dtype, trust_remote_code, model_kwargs, pipeline_class, **kwargs)
1095 kwargs["device"] = device
1096
-> 1097 return pipeline_class(model=model, framework=framework, task=task, **kwargs)

/usr/local/lib/python3.10/dist-packages/transformers/pipelines/text2text_generation.py in init(self, *args, **kwargs)
65
66 def init(self, *args, **kwargs):
---> 67 super().init(*args, **kwargs)
68
69 self.check_model_type(

/usr/local/lib/python3.10/dist-packages/transformers/pipelines/base.py in init(self, model, tokenizer, feature_extractor, image_processor, modelcard, framework, task, args_parser, device, torch_dtype, binary_output, **kwargs)
880 self.device = torch.device(f"mps:{device}")
881 else:
--> 882 raise ValueError(f"{device} unrecognized or not available.")
883 else:
884 self.device = device if device is not None else -1

ValueError: 0 unrecognized or not available.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions