AjithBharadwaj commited on
Commit
a6fa6b2
·
verified ·
1 Parent(s): b9ddaf9

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -4,10 +4,10 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline,BitsAndBy
4
  # import bitsandbytes
5
  from langchain_core.prompts import PromptTemplate
6
 
7
- # quants = BitsAndBytesConfig(load_in_4bit=True)
8
  model_id = "mistralai/Mistral-7B-Instruct-v0.2"
9
- tokenizer = AutoTokenizer.from_pretrained(model_id,load_in_8bit=True)
10
- model = AutoModelForCausalLM.from_pretrained(model_id,load_in_8bit=True)
11
  pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
12
  hf = HuggingFacePipeline(pipeline=pipe)
13
 
 
4
  # import bitsandbytes
5
  from langchain_core.prompts import PromptTemplate
6
 
7
+ quants = BitsAndBytesConfig(load_in_4bit=True)
8
  model_id = "mistralai/Mistral-7B-Instruct-v0.2"
9
+ tokenizer = AutoTokenizer.from_pretrained(model_id,qunatization_config = quants)
10
+ model = AutoModelForCausalLM.from_pretrained(model_id,qunatization_config = quants)
11
  pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
12
  hf = HuggingFacePipeline(pipeline=pipe)
13