chayanbhansali commited on
Commit
473e3b4
·
verified ·
1 Parent(s): 0b794ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -6,10 +6,16 @@ import numpy as np
6
  import torch
7
 
8
  class RAGChatbot:
9
- def __init__(self, model_name="TheBloke/Mistral-7B-Instruct-v0.1-GPTQ", embedding_model="all-MiniLM-L6-v2"):
 
 
10
  # Initialize tokenizer and model
11
  self.tokenizer = AutoTokenizer.from_pretrained(model_name)
12
- self.model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
 
 
 
 
13
 
14
  # Initialize embedding model
15
  self.embedding_model = SentenceTransformer(embedding_model)
 
6
  import torch
7
 
8
  class RAGChatbot:
9
+ def __init__(self,
10
+ model_name="facebook/opt-350m",
11
+ embedding_model="all-MiniLM-L6-v2"):
12
  # Initialize tokenizer and model
13
  self.tokenizer = AutoTokenizer.from_pretrained(model_name)
14
+ self.model = AutoModelForCausalLM.from_pretrained(
15
+ model_name,
16
+ torch_dtype=torch.float16,
17
+ device_map="auto"
18
+ )
19
 
20
  # Initialize embedding model
21
  self.embedding_model = SentenceTransformer(embedding_model)