Pamudu13 commited on
Commit
47994b5
·
verified ·
1 Parent(s): 2e84d85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -11,13 +11,18 @@ app = Flask(__name__, template_folder=os.getcwd())
11
 
12
  # Default settings
13
  class ChatConfig:
14
- MODEL = "google/gemma-3-27b-it"
15
  DEFAULT_SYSTEM_MSG = "You are an AI assistant answering only based on the uploaded PDF."
16
  DEFAULT_MAX_TOKENS = 512
17
  DEFAULT_TEMP = 0.3
18
  DEFAULT_TOP_P = 0.95
19
 
20
- client = InferenceClient(ChatConfig.MODEL)
 
 
 
 
 
21
  embed_model = SentenceTransformer("all-MiniLM-L6-v2", cache_folder="/tmp")
22
  vector_dim = 384 # Embedding size
23
  index = faiss.IndexFlatL2(vector_dim) # FAISS index
 
11
 
12
  # Default settings
13
  class ChatConfig:
14
+ MODEL = "mistralai/Mistral-7B-Instruct-v0.2"
15
  DEFAULT_SYSTEM_MSG = "You are an AI assistant answering only based on the uploaded PDF."
16
  DEFAULT_MAX_TOKENS = 512
17
  DEFAULT_TEMP = 0.3
18
  DEFAULT_TOP_P = 0.95
19
 
20
+ # Get the token from environment variable
21
+ HF_TOKEN = os.getenv('HUGGINGFACE_TOKEN')
22
+ client = InferenceClient(
23
+ ChatConfig.MODEL,
24
+ token=HF_TOKEN # Add your Hugging Face token here
25
+ )
26
  embed_model = SentenceTransformer("all-MiniLM-L6-v2", cache_folder="/tmp")
27
  vector_dim = 384 # Embedding size
28
  index = faiss.IndexFlatL2(vector_dim) # FAISS index