alx-d commited on
Commit
09cb57f
·
verified ·
1 Parent(s): 64c43f8

Update philosophy.py

Browse files
Files changed (1) hide show
  1. philosophy.py +6 -3
philosophy.py CHANGED
@@ -43,8 +43,11 @@ def create_service_context():
43
  # max_input_size = 32768 # gpt-4-32k
44
  # num_outputs = 30000 # gpt-4-32k
45
  # num_outputs = 3500 # max 4096 # gpt-4o
46
- max_input_size = 8192
47
- num_outputs = 7500 # Safe upper limit to ensure total tokens do not exceed 8192
 
 
 
48
  max_chunk_overlap = 20
49
  chunk_size_limit = 600
50
 
@@ -52,7 +55,7 @@ def create_service_context():
52
  prompt_helper = PromptHelper(max_input_size, num_outputs, chunk_overlap_ratio=0.1, chunk_size_limit=chunk_size_limit)
53
 
54
  # LLMPredictor is a wrapper class around LangChain's LLMChain that allows easy integration into LlamaIndex
55
- llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0.5, model_name="gpt-4", max_tokens=num_outputs)) # gpt-4-32k
56
 
57
  #constructs service_context
58
  service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor, prompt_helper=prompt_helper)
 
43
  # max_input_size = 32768 # gpt-4-32k
44
  # num_outputs = 30000 # gpt-4-32k
45
  # num_outputs = 3500 # max 4096 # gpt-4o
46
+ # max_input_size = 8192 # gpt-4
47
+ # num_outputs = 7500 # gpt-4
48
+ max_input_size = 16384
49
+ num_outputs = 15000 # Safe upper limit to ensure total tokens do not exceed 8192
50
+
51
  max_chunk_overlap = 20
52
  chunk_size_limit = 600
53
 
 
55
  prompt_helper = PromptHelper(max_input_size, num_outputs, chunk_overlap_ratio=0.1, chunk_size_limit=chunk_size_limit)
56
 
57
  # LLMPredictor is a wrapper class around LangChain's LLMChain that allows easy integration into LlamaIndex
58
+ llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0.5, model_name="gpt-3.5-turbo", max_tokens=num_outputs)) # gpt-4-32k
59
 
60
  #constructs service_context
61
  service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor, prompt_helper=prompt_helper)