ArturG9 commited on
Commit
433b27a
·
verified ·
1 Parent(s): 2390875

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -15
app.py CHANGED
@@ -47,21 +47,17 @@ retriever = retriever_from_chroma(docs, hf, "mmr", 6)
47
 
48
  callback_manager = CallbackManager([StreamingStdOutCallbackHandler()])
49
 
50
- @st.cache_resource
51
- def load_llm(model_path):
52
- return LlamaCpp(
53
- model_path=model_path,
54
- n_gpu_layers=0,
55
- temperature=0.0,
56
- top_p=0.5,
57
- n_ctx=7000,
58
- max_tokens=350,
59
- repeat_penalty=1.7,
60
- callback_manager=callback_manager,
61
- verbose=False,
62
- )
63
-
64
- llm = load_llm(model_path)
65
 
66
  contextualize_q_system_prompt = """Given a context, chat history and the latest user question
67
  which maybe reference context in the chat history, formulate a standalone question
 
47
 
48
  callback_manager = CallbackManager([StreamingStdOutCallbackHandler()])
49
 
50
+ llm = llamacpp.LlamaCpp(
51
+ model_path="/kaggle/working/phi-2-layla-v1-chatml-Q8_0.gguf",
52
+ n_gpu_layers=1,
53
+ temperature=0.1,
54
+ top_p = 0.9,
55
+ n_ctx=22000,
56
+ max_tokens=200,
57
+ repeat_penalty=1.7,
58
+ callback_manager = callback_manager,
59
+ verbose=False,
60
+ )
 
 
 
 
61
 
62
  contextualize_q_system_prompt = """Given a context, chat history and the latest user question
63
  which maybe reference context in the chat history, formulate a standalone question