mitulagr2 commited on
Commit
de8de19
·
1 Parent(s): 4399f8b

Update to qwen:0.5b

Browse files
Files changed (2) hide show
  1. app/rag.py +3 -3
  2. start_service.sh +1 -1
app/rag.py CHANGED
@@ -15,8 +15,8 @@ class ChatPDF:
15
  chain = None
16
 
17
  def __init__(self):
18
- self.model = ChatOllama(model="tinyllama")
19
- self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=1024, chunk_overlap=96)
20
  self.prompt = PromptTemplate.from_template(
21
  """
22
  You are an assistant for question-answering tasks. Use the following pieces of context
@@ -36,7 +36,7 @@ class ChatPDF:
36
  self.retriever = vector_store.as_retriever(
37
  search_type="similarity_score_threshold",
38
  search_kwargs={
39
- "k": 7,
40
  "score_threshold": 0.5,
41
  },
42
  )
 
15
  chain = None
16
 
17
  def __init__(self):
18
+ self.model = ChatOllama(model="qwen:0.5b")
19
+ self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=2048, chunk_overlap=128)
20
  self.prompt = PromptTemplate.from_template(
21
  """
22
  You are an assistant for question-answering tasks. Use the following pieces of context
 
36
  self.retriever = vector_store.as_retriever(
37
  search_type="similarity_score_threshold",
38
  search_kwargs={
39
+ "k": 15,
40
  "score_threshold": 0.5,
41
  },
42
  )
start_service.sh CHANGED
@@ -7,7 +7,7 @@ ollama serve &
7
  sleep 5
8
 
9
  # Pull and run <YOUR_MODEL_NAME>
10
- ollama pull tinyllama
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 qwen:0.5b
11
 
12
  #
13
  fastapi run /code/app/main.py --port 7860