pratikroy311 commited on
Commit
c6e8170
·
verified ·
1 Parent(s): 2df718a

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +7 -4
utils.py CHANGED
@@ -6,7 +6,7 @@ from langchain.vectorstores import Chroma
6
  from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
7
  from langchain_community.llms import HuggingFacePipeline
8
  from langchain.chains.question_answering import load_qa_chain
9
- from sentence_transformers import SentenceTransformer
10
 
11
  # Load and process documents
12
  dir = "data"
@@ -41,9 +41,12 @@ def get_similar_docs(query, k=2, score=False):
41
 
42
  # Load LLM model from Hugging Face
43
 
44
- model_name = "HuggingFaceH4/zephyr-7b-beta"
45
- model = AutoModelForCausalLM.from_pretrained(model_name)
46
- tokenizer = AutoTokenizer.from_pretrained(model_name)
 
 
 
47
 
48
  text_generation_pipeline = pipeline(
49
  model=model,
 
6
  from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
7
  from langchain_community.llms import HuggingFacePipeline
8
  from langchain.chains.question_answering import load_qa_chain
9
+
10
 
11
  # Load and process documents
12
  dir = "data"
 
41
 
42
  # Load LLM model from Hugging Face
43
 
44
+ # model_name = "HuggingFaceH4/zephyr-7b-beta"
45
+ # model = AutoModelForCausalLM.from_pretrained(model_name)
46
+ # tokenizer = AutoTokenizer.from_pretrained(model_name)
47
+
48
+ model = AutoModelForCausalLM.from_pretrained("gpt2")
49
+ tokenizer = AutoTokenizer.from_pretrained("gpt2")
50
 
51
  text_generation_pipeline = pipeline(
52
  model=model,