Spaces:
Running
Running
john
commited on
Commit
•
77cf48c
1
Parent(s):
c798d0e
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ os.system('CMAKE_ARGS="-DLLAMA_OPENBLAS=on" FORCE_CMAKE=1 pip install llama-cpp-
|
|
4 |
import wget
|
5 |
from llama_cpp import Llama
|
6 |
import random
|
7 |
-
url = 'https://huggingface.co/TheBloke/
|
8 |
filename = wget.download(url)
|
9 |
llm2 = Llama(model_path=filename, seed=random.randint(1, 2**31))
|
10 |
theme = gr.themes.Soft(
|
@@ -29,21 +29,9 @@ with gr.Blocks(theme=theme) as demo:
|
|
29 |
#token1 = llm.tokenize(b"### Instruction: ")
|
30 |
#token2 = llm.tokenize(instruction.encode())
|
31 |
#token3 = llm2.tokenize(b"USER: ")
|
32 |
-
|
33 |
-
###
|
34 |
-
|
35 |
-
''')
|
36 |
-
token2 = llm2.tokenize(b'''
|
37 |
-
### User:
|
38 |
-
''')
|
39 |
-
token3 = llm2.tokenize(user_message.encode())
|
40 |
-
token4 = llm2.tokenize(b'''
|
41 |
-
### Response:
|
42 |
-
''')
|
43 |
-
tokens = token1 + token2 + token3 + token4
|
44 |
-
#tokens3 = llm2.tokenize(user_message.encode())
|
45 |
-
#token4 = llm2.tokenize(b"\n\n### Response:")
|
46 |
-
#tokens = tokens3 + token4
|
47 |
history[-1][1] = ""
|
48 |
count = 0
|
49 |
output = ""
|
|
|
4 |
import wget
|
5 |
from llama_cpp import Llama
|
6 |
import random
|
7 |
+
url = 'https://huggingface.co/TheBloke/WizardLM-7B-uncensored-GGML/resolve/main/WizardLM-7B-uncensored.ggmlv3.q2_K.bin'
|
8 |
filename = wget.download(url)
|
9 |
llm2 = Llama(model_path=filename, seed=random.randint(1, 2**31))
|
10 |
theme = gr.themes.Soft(
|
|
|
29 |
#token1 = llm.tokenize(b"### Instruction: ")
|
30 |
#token2 = llm.tokenize(instruction.encode())
|
31 |
#token3 = llm2.tokenize(b"USER: ")
|
32 |
+
tokens5 = llm2.tokenize(user_message.encode())
|
33 |
+
token4 = llm2.tokenize(b"\n\n### Response:")
|
34 |
+
#tokens = tokens5 + token4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
history[-1][1] = ""
|
36 |
count = 0
|
37 |
output = ""
|