CoruNethron commited on
Commit
579c6dd
·
verified ·
1 Parent(s): cc7892c

Update olapp.py

Browse files
Files changed (1) hide show
  1. olapp.py +8 -7
olapp.py CHANGED
@@ -6,7 +6,7 @@ from llama_cpp import Llama
6
 
7
  print("Loading model...")
8
 
9
- llm = Llama(model_path="/home/oluser/olapp/model-q4_K.gguf")
10
 
11
  print("Model loaded!")
12
 
@@ -18,15 +18,16 @@ class OlHandler(BaseHTTPRequestHandler):
18
  query_components = dict(qc.split("=") for qc in query.split("&"))
19
  q = urllib.parse.unquote_plus(query_components["q"])
20
 
21
- output = llm.create_completion(
22
- q,
23
- max_tokens=32,
24
- echo=False
25
- )["choices"][0]["text"].encode("cp1252").decode("utf-8")
26
 
27
  self.send_response(200)
28
  self.end_headers()
29
- self.wfile.write(output.encode('utf-8'))
 
30
  return
31
 
32
 
 
6
 
7
  print("Loading model...")
8
 
9
+ # llm = Llama(model_path="/home/oluser/olapp/model-q4_K.gguf")
10
 
11
  print("Model loaded!")
12
 
 
18
  query_components = dict(qc.split("=") for qc in query.split("&"))
19
  q = urllib.parse.unquote_plus(query_components["q"])
20
 
21
+ #output = llm.create_completion(
22
+ # q,
23
+ # max_tokens=32,
24
+ # echo=False
25
+ #)["choices"][0]["text"].encode("cp1252").decode("utf-8")
26
 
27
  self.send_response(200)
28
  self.end_headers()
29
+ #self.wfile.write(output.encode('utf-8'))
30
+ self.wfile.write(q.encode('utf-8'))
31
  return
32
 
33