Spaces:
Build error
Build error
Samuel L Meyers
commited on
Commit
·
320c4ed
1
Parent(s):
ebdfe5b
Hello, future.
Browse files
app.py
CHANGED
|
@@ -35,9 +35,12 @@ lcpp_model = Llama(model_path=mdlpath)
|
|
| 35 |
|
| 36 |
def m3b_talk(text):
|
| 37 |
resp = ""
|
| 38 |
-
|
|
|
|
|
|
|
| 39 |
resp += token
|
| 40 |
-
|
|
|
|
| 41 |
|
| 42 |
def main():
|
| 43 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 35 |
|
| 36 |
def m3b_talk(text):
|
| 37 |
resp = ""
|
| 38 |
+
formattedQuery = "<s> [|User|]" + text + "</s> [|Assistant|]"
|
| 39 |
+
|
| 40 |
+
for token in lcpp_model(formattedQuery, stop=["[|User|]", "\n"], echo=True):
|
| 41 |
resp += token
|
| 42 |
+
answer = resp["choices"][0]["text"].replace(formattedQuery, "")
|
| 43 |
+
return answer
|
| 44 |
|
| 45 |
def main():
|
| 46 |
logging.basicConfig(level=logging.INFO)
|