Spaces:
Runtime error
Runtime error
Hristo ZHANG 张鹤立
commited on
Commit
•
cc4e355
1
Parent(s):
a023bcb
update
Browse files- app.py +6 -3
- requirements.txt +1 -1
app.py
CHANGED
@@ -20,8 +20,8 @@ parser.add_argument("-t", "--threads", default=0, type=int, help="number of thre
|
|
20 |
parser.add_argument("--plain", action="store_true", help="display in plain text without markdown support")
|
21 |
args = parser.parse_args()
|
22 |
|
23 |
-
from
|
24 |
-
|
25 |
|
26 |
|
27 |
|
@@ -41,7 +41,10 @@ def predict(input, system_prompt, chatbot, max_length, ctx_length, top_p, temper
|
|
41 |
num_threads=0,
|
42 |
stream=True,
|
43 |
)
|
44 |
-
|
|
|
|
|
|
|
45 |
response += response_piece
|
46 |
chatbot[-1] = (chatbot[-1][0], response)
|
47 |
|
|
|
20 |
parser.add_argument("--plain", action="store_true", help="display in plain text without markdown support")
|
21 |
args = parser.parse_args()
|
22 |
|
23 |
+
from llama_cpp import Llama
|
24 |
+
llm = Llama(model_path=model_file)
|
25 |
|
26 |
|
27 |
|
|
|
41 |
num_threads=0,
|
42 |
stream=True,
|
43 |
)
|
44 |
+
output = llm(input)
|
45 |
+
response = output['choices'][0]['text']
|
46 |
+
|
47 |
+
for response_piece in response:
|
48 |
response += response_piece
|
49 |
chatbot[-1] = (chatbot[-1][0], response)
|
50 |
|
requirements.txt
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
gradio
|
2 |
-
|
|
|
1 |
gradio
|
2 |
+
llama_cpp_python==0.2.14
|