zeeshan391 commited on
Commit
128258c
·
verified ·
1 Parent(s): 4592519
Files changed (1) hide show
  1. app.py +15 -5
app.py CHANGED
@@ -2,7 +2,7 @@ from fastapi import FastAPI, HTTPException
2
  from pydantic import BaseModel
3
  from langchain_community.llms import LlamaCpp
4
  from huggingface_hub.file_download import http_get
5
- # from llama_cpp import Llama
6
  from langchain_core.callbacks import CallbackManager, StreamingStdOutCallbackHandler
7
  from langchain_core.prompts import ChatPromptTemplate
8
 
@@ -45,15 +45,25 @@ def load_model(
45
  # n_ctx=1024
46
  # )
47
 
48
- model = LlamaCpp(
 
 
 
 
 
 
 
 
 
 
49
  model_path=final_model_path,
50
  temperature=0.3,
51
  max_tokens=2000,
52
- top_p=1,
53
  n_ctx=1024,
54
- callback_manager=callback_manager,
55
- verbose=True,
56
  )
 
57
 
58
  print("Model loaded!")
59
  return model
 
2
  from pydantic import BaseModel
3
  from langchain_community.llms import LlamaCpp
4
  from huggingface_hub.file_download import http_get
5
+ from llama_cpp import Llama
6
  from langchain_core.callbacks import CallbackManager, StreamingStdOutCallbackHandler
7
  from langchain_core.prompts import ChatPromptTemplate
8
 
 
45
  # n_ctx=1024
46
  # )
47
 
48
+ # model = LlamaCpp(
49
+ # model_path=final_model_path,
50
+ # temperature=0.3,
51
+ # max_tokens=2000,
52
+ # top_p=1,
53
+ # n_ctx=1024,
54
+ # callback_manager=callback_manager,
55
+ # verbose=True,
56
+ # )
57
+
58
+ model = Llama(
59
  model_path=final_model_path,
60
  temperature=0.3,
61
  max_tokens=2000,
 
62
  n_ctx=1024,
63
+ # n_threads=8,
64
+ echo=False
65
  )
66
+
67
 
68
  print("Model loaded!")
69
  return model