umerforsure commited on
Commit
eccbfd8
Β·
1 Parent(s): ba51d64

πŸ” Switched to LaMini-Flan-T5-783M for better CPU reasoning

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -12,10 +12,10 @@ from langchain_community.embeddings import HuggingFaceEmbeddings
12
  from langchain.text_splitter import RecursiveCharacterTextSplitter
13
  from langchain_core.documents import Document
14
 
15
- # Load Reasoning Model (CPU-friendly + stronger than base)
16
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
17
 
18
- model_id = "google/flan-t5-large"
 
19
  tokenizer = AutoTokenizer.from_pretrained(model_id)
20
  model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
21
 
@@ -29,6 +29,7 @@ reasoning_pipeline = pipeline(
29
  )
30
 
31
 
 
32
  # Embedding Model
33
  embedding_model = HuggingFaceEmbeddings(model_name="all-MiniLM-L6-v2")
34
  vectorstore = None
 
12
  from langchain.text_splitter import RecursiveCharacterTextSplitter
13
  from langchain_core.documents import Document
14
 
 
15
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
16
 
17
+ # Load Reasoning Model (Balanced for CPU + Reasoning)
18
+ model_id = "MBZUAI/LaMini-Flan-T5-783M"
19
  tokenizer = AutoTokenizer.from_pretrained(model_id)
20
  model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
21
 
 
29
  )
30
 
31
 
32
+
33
  # Embedding Model
34
  embedding_model = HuggingFaceEmbeddings(model_name="all-MiniLM-L6-v2")
35
  vectorstore = None