Ahmed007 commited on
Commit
7ec63cb
·
verified ·
1 Parent(s): dd985c7

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -6
main.py CHANGED
@@ -1,23 +1,18 @@
1
  from flask import Flask, request, jsonify
2
  from langchain_community.llms import LlamaCpp
3
- from langchain.callbacks.manager import CallbackManager
4
- from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
5
- from langchain.prompts import PromptTemplate
6
- from langchain.schema.output_parser import StrOutputParser
7
 
8
  app = Flask(__name__)
9
 
10
  n_gpu_layers = 0
11
  n_batch = 1024
12
 
13
- callback_manager = CallbackManager([StreamingStdOutCallbackHandler()])
14
 
15
  llm = LlamaCpp(
16
  model_path="Phi-3-mini-4k-instruct-q4.gguf", # path to GGUF file
17
  temperature=0.1,
18
  n_gpu_layers=n_gpu_layers,
19
  n_batch=n_batch,
20
- callback_manager=callback_manager,
21
  verbose=True,
22
  n_ctx=2048
23
  )
 
1
  from flask import Flask, request, jsonify
2
  from langchain_community.llms import LlamaCpp
3
+
 
 
 
4
 
5
  app = Flask(__name__)
6
 
7
  n_gpu_layers = 0
8
  n_batch = 1024
9
 
 
10
 
11
  llm = LlamaCpp(
12
  model_path="Phi-3-mini-4k-instruct-q4.gguf", # path to GGUF file
13
  temperature=0.1,
14
  n_gpu_layers=n_gpu_layers,
15
  n_batch=n_batch,
 
16
  verbose=True,
17
  n_ctx=2048
18
  )