Spaces:
Build error
Build error
Samuel L Meyers
commited on
Commit
·
c17b3f7
1
Parent(s):
ecd2bcd
Use llama-cpp-python
Browse files- __pycache__/conversation.cpython-311.pyc +0 -0
- app.py +3 -3
- requirements.txt +1 -1
__pycache__/conversation.cpython-311.pyc
ADDED
|
Binary file (9.27 kB). View file
|
|
|
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import torch
|
|
| 6 |
|
| 7 |
from conversation import get_default_conv_template
|
| 8 |
import gradio as gr
|
| 9 |
-
from
|
| 10 |
import wget
|
| 11 |
|
| 12 |
"""
|
|
@@ -31,11 +31,11 @@ model_path = "minichat-3b.q8_0.gguf"
|
|
| 31 |
|
| 32 |
mdlpath = hf_hub_download(repo_id="afrideva/MiniChat-3B-GGUF", filename=model_path)
|
| 33 |
|
| 34 |
-
lcpp_model =
|
| 35 |
|
| 36 |
def m3b_talk(text):
|
| 37 |
resp = ""
|
| 38 |
-
for token in lcpp_model
|
| 39 |
resp += token
|
| 40 |
return resp
|
| 41 |
|
|
|
|
| 6 |
|
| 7 |
from conversation import get_default_conv_template
|
| 8 |
import gradio as gr
|
| 9 |
+
from llama_cpp import Llama
|
| 10 |
import wget
|
| 11 |
|
| 12 |
"""
|
|
|
|
| 31 |
|
| 32 |
mdlpath = hf_hub_download(repo_id="afrideva/MiniChat-3B-GGUF", filename=model_path)
|
| 33 |
|
| 34 |
+
lcpp_model = Llama(model_path=mdlpath)
|
| 35 |
|
| 36 |
def m3b_talk(text):
|
| 37 |
resp = ""
|
| 38 |
+
for token in lcpp_model("<s> [|User|]" + text + "</s> [|Assistant|]", stop=["[|User|]", "\n"], echo=True):
|
| 39 |
resp += token
|
| 40 |
return resp
|
| 41 |
|
requirements.txt
CHANGED
|
@@ -8,5 +8,5 @@ git+https://github.com/huggingface/transformers
|
|
| 8 |
torch
|
| 9 |
sentencepiece
|
| 10 |
accelerate
|
| 11 |
-
|
| 12 |
wget
|
|
|
|
| 8 |
torch
|
| 9 |
sentencepiece
|
| 10 |
accelerate
|
| 11 |
+
llama-cpp-python>=0.2.18
|
| 12 |
wget
|