zeeshan391 commited on
Commit
0ab9f12
·
verified ·
1 Parent(s): c363d1a
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -1,6 +1,6 @@
1
  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
@@ -45,25 +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
- 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
 
1
  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
 
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