Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,16 +2,14 @@ import gradio as gr
|
|
2 |
import os
|
3 |
from pathlib import Path
|
4 |
import argparse
|
5 |
-
model_file = "
|
6 |
-
if not os.path.isfile(
|
7 |
-
os.system("wget -c https://huggingface.co/
|
8 |
|
9 |
DEFAULT_MODEL_PATH = model_file
|
10 |
|
11 |
from llama_cpp import Llama
|
12 |
-
llm = Llama(model_path=model_file)
|
13 |
-
old_tokenize = llm._model.tokenize
|
14 |
-
llm._model.tokenize = lambda text, add_bos, spec: old_tokenize(text, False, spec)
|
15 |
|
16 |
|
17 |
def predict(input, chatbot, max_length, top_p, temperature, history):
|
|
|
2 |
import os
|
3 |
from pathlib import Path
|
4 |
import argparse
|
5 |
+
model_file = "yi-6b.Q4_0.gguf"
|
6 |
+
if not os.path.isfile(model_file):
|
7 |
+
os.system("wget -c https://huggingface.co/TheBloke/Yi-6B-GGUF/resolve/main/yi-6b.Q4_0.gguf")
|
8 |
|
9 |
DEFAULT_MODEL_PATH = model_file
|
10 |
|
11 |
from llama_cpp import Llama
|
12 |
+
llm = Llama(model_path=model_file, model_type="mistral")
|
|
|
|
|
13 |
|
14 |
|
15 |
def predict(input, chatbot, max_length, top_p, temperature, history):
|