Spaces:
Paused
Paused
Update olapp.py
Browse files
olapp.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
from http.server import HTTPServer, BaseHTTPRequestHandler
|
2 |
-
from urllib.parse import urlparse
|
3 |
import urllib.parse
|
4 |
import json
|
5 |
from llama_cpp import Llama
|
@@ -14,9 +14,9 @@ print("Model loaded!")
|
|
14 |
class OlHandler(BaseHTTPRequestHandler):
|
15 |
|
16 |
def do_GET(self):
|
17 |
-
|
18 |
-
|
19 |
-
q =
|
20 |
|
21 |
#output = llm.create_completion(
|
22 |
# q,
|
|
|
1 |
from http.server import HTTPServer, BaseHTTPRequestHandler
|
2 |
+
from urllib.parse import urlparse, parse_qs
|
3 |
import urllib.parse
|
4 |
import json
|
5 |
from llama_cpp import Llama
|
|
|
14 |
class OlHandler(BaseHTTPRequestHandler):
|
15 |
|
16 |
def do_GET(self):
|
17 |
+
query_components = parse_qs(urlparse(self.path).query)
|
18 |
+
#q = urllib.parse.unquote_plus(query_components["q"]) #.encode("cp1252").decode("utf-8"))
|
19 |
+
q = query_components["q"][0]
|
20 |
|
21 |
#output = llm.create_completion(
|
22 |
# q,
|