Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

LangChain + Hugging Face -> LangChain LLM import error

$
0
0

I'm trying to do the following simple code:

from transformers import pipelineimport langchainfrom langchain.llms import HuggingFacePipelinemodel_name = "bert-base-uncased"task = "question-answering"

I get the following error:

  • ERROR: TypeError: issubclass() arg 1 must be a class
  • LINE: from langchain.llms import HuggingFacePipeline

I found the following questions (that didn't help):

  1. TypeError: issubclass() arg 1 must be a class when importing langchain in Flask
  2. FastAPI - "TypeError: issubclass() arg 1 must be a class" with modular imports
  3. TypeError: issubclass() arg 1 must be a class when using langchain in azure
  4. import langchain => Error : TypeError: issubclass() arg 1 must be a class

I'm using Databricks with the following:

  • Cluster 1:
    • Runtime: 13.2 ML (includes Apache Spark 3.4.0, GPU, Scala 2.12)
    • Worker & Driver type: Standard_NC21s_v3 224 GB Memory, 2 GPUs
    • Libraries: cluster1libraries
  • Cluster 2:
    • Runtime: 12.2 LTS ML (includes Apache Spark 3.3.2, Scala 2.12)
    • Node type: Standard_DS5_v2 56 GB Memory, 16 Cores
    • Libraries: cluster2libraries

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>