ccm commited on
Commit
2bfc242
β€’
1 Parent(s): 075069c

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -4
main.py CHANGED
@@ -26,7 +26,7 @@ EXAMPLE_QUERIES = [
26
  "What is known about different modes for human-AI teaming?",
27
  ]
28
  EMBEDDING_MODEL_NAME = "allenai-specter"
29
- LLM_MODEL_NAME = "Qwen/Qwen2-7B-Instruct-AWQ"
30
 
31
  # Load the dataset and convert to pandas
32
  data = pandas.read_parquet("hf://datasets/ccm/publications/data/train-00000-of-00001.parquet")
@@ -42,12 +42,12 @@ data.reset_index(inplace=True)
42
  model = sentence_transformers.SentenceTransformer(EMBEDDING_MODEL_NAME)
43
 
44
  # Create an LLM pipeline that we can send queries to
45
- tokenizer = transformers.AutoTokenizer.from_pretrained(LLM_MODEL_NAME, torch_dtype=torch.float16)
46
  streamer = transformers.TextIteratorStreamer(
47
- tokenizer, skip_prompt=True, skip_special_tokens=True, torch_dtype=torch.float16
48
  )
49
  chatmodel = transformers.AutoModelForCausalLM.from_pretrained(
50
- LLM_MODEL_NAME, device_map="auto", torch_dtype=torch.float16
51
  )
52
 
53
  # Create a FAISS index for fast similarity search
 
26
  "What is known about different modes for human-AI teaming?",
27
  ]
28
  EMBEDDING_MODEL_NAME = "allenai-specter"
29
+ LLM_MODEL_NAME = "Qwen/Qwen2-7B-Instruct"
30
 
31
  # Load the dataset and convert to pandas
32
  data = pandas.read_parquet("hf://datasets/ccm/publications/data/train-00000-of-00001.parquet")
 
42
  model = sentence_transformers.SentenceTransformer(EMBEDDING_MODEL_NAME)
43
 
44
  # Create an LLM pipeline that we can send queries to
45
+ tokenizer = transformers.AutoTokenizer.from_pretrained(LLM_MODEL_NAME)
46
  streamer = transformers.TextIteratorStreamer(
47
+ tokenizer, skip_prompt=True, skip_special_tokens=True
48
  )
49
  chatmodel = transformers.AutoModelForCausalLM.from_pretrained(
50
+ LLM_MODEL_NAME, device_map="auto", torch_dtype="auto"
51
  )
52
 
53
  # Create a FAISS index for fast similarity search