mitulagr2 commited on
Commit
ffe1a73
·
1 Parent(s): da60393

Update to phi3:mini

Browse files
Files changed (2) hide show
  1. app/rag.py +3 -3
  2. start_service.sh +1 -1
app/rag.py CHANGED
@@ -15,11 +15,11 @@ class ChatPDF:
15
  chain = None
16
 
17
  def __init__(self):
18
- self.model = ChatOllama(model="gemma:2b")
19
  self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=128, chunk_overlap=8)
20
  self.prompt = PromptTemplate.from_template(
21
  """
22
- <s> [INST] Use the pieces of context to answer the question concisely.[/INST] </s>
23
  [INST] Question: {question}
24
  Context: {context}
25
  Answer: [/INST]
@@ -35,7 +35,7 @@ class ChatPDF:
35
  self.retriever = vector_store.as_retriever(
36
  search_type="similarity_score_threshold",
37
  search_kwargs={
38
- "k": 56,
39
  "score_threshold": 0.5,
40
  },
41
  )
 
15
  chain = None
16
 
17
  def __init__(self):
18
+ self.model = ChatOllama(model="phi3:mini")
19
  self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=128, chunk_overlap=8)
20
  self.prompt = PromptTemplate.from_template(
21
  """
22
+ <s> [INST] Use the context to answer the question.[/INST] </s>
23
  [INST] Question: {question}
24
  Context: {context}
25
  Answer: [/INST]
 
35
  self.retriever = vector_store.as_retriever(
36
  search_type="similarity_score_threshold",
37
  search_kwargs={
38
+ "k": 24,
39
  "score_threshold": 0.5,
40
  },
41
  )
start_service.sh CHANGED
@@ -7,7 +7,7 @@ ollama serve &
7
  sleep 5
8
 
9
  # Pull and run <YOUR_MODEL_NAME>
10
- ollama pull gemma:2b
11
 
12
  #
13
  fastapi run /code/app/main.py --port 7860
 
7
  sleep 5
8
 
9
  # Pull and run <YOUR_MODEL_NAME>
10
+ ollama pull phi3:mini
11
 
12
  #
13
  fastapi run /code/app/main.py --port 7860