Update huggingface.py add import torch statement

Added import torch statement
This commit is contained in:
Archit-Kohli
2023-10-05 14:27:15 +05:30
committed by GitHub
parent 5b4e517d9d
commit 7ce1dc9069

View File

@@ -7,6 +7,7 @@ class HuggingFaceLLM(BaseLLM):
from langchain.llms import HuggingFacePipeline
if q:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline, BitsAndBytesConfig
tokenizer = AutoTokenizer.from_pretrained(llm_name)
bnb_config = BitsAndBytesConfig(