viswazgummadi commited on
Commit
a9833c6
·
1 Parent(s): 1e3465b
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -8,17 +8,19 @@ from llama_index.core.postprocessor import SimilarityPostprocessor
8
  from llama_index.embeddings.huggingface import HuggingFaceEmbedding
9
  from llama_index.core import Document
10
  import re
11
- from transformers import AutoTokenizer, AutoModelForCausalLM
 
12
 
13
  print("started...........................................................")
14
- model_id ="Dobby091/KOKO"
15
- tokenizer = AutoTokenizer.from_pretrained(model_id)
16
- model = AutoModelForCausalLM.from_pretrained(
17
- model_id,
18
  device_map="auto",
19
- cache_dir = "/mnt/data1/backup/viswaz/Project_K/huggingface_cache/",
20
  )
21
 
 
22
  print("stage1 ------------------ completed")
23
 
24
  def generate_response(prompt, model):
 
8
  from llama_index.embeddings.huggingface import HuggingFaceEmbedding
9
  from llama_index.core import Document
10
  import re
11
+ from transformers import LlamaTokenizer, LlamaForCausalLM
12
+
13
 
14
  print("started...........................................................")
15
+ model_path = "/mnt/data1/backup/viswaz/Project_K/huggingface_cache/Mistral-7B-Instruct-v0.2"
16
+ tokenizer = LlamaTokenizer.from_pretrained(model_path)
17
+ model = LlamaForCausalLM.from_pretrained(
18
+ model_path,
19
  device_map="auto",
20
+ cache_dir="/mnt/data1/backup/viswaz/Project_K/huggingface_cache/",
21
  )
22
 
23
+
24
  print("stage1 ------------------ completed")
25
 
26
  def generate_response(prompt, model):