Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ from llama_cpp import Llama
|
|
8 |
from huggingface_hub import hf_hub_download
|
9 |
|
10 |
hf_hub_download(repo_id="Pi3141/alpaca-lora-13B-ggml", filename="ggml-model-q4_1.bin", local_dir=".")
|
11 |
-
llm = Llama(model_path="./ggml-model-q4_1.bin"
|
12 |
|
13 |
|
14 |
ins = '''Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
@@ -30,7 +30,7 @@ theme = gr.themes.Monochrome(
|
|
30 |
|
31 |
def generate(instruction):
|
32 |
result = ""
|
33 |
-
for x in llm(ins.format(instruction), stop=['### Instruction:', '### End'], stream=True):
|
34 |
result += x['choices'][0]['text']
|
35 |
yield result
|
36 |
|
|
|
8 |
from huggingface_hub import hf_hub_download
|
9 |
|
10 |
hf_hub_download(repo_id="Pi3141/alpaca-lora-13B-ggml", filename="ggml-model-q4_1.bin", local_dir=".")
|
11 |
+
llm = Llama(model_path="./ggml-model-q4_1.bin")
|
12 |
|
13 |
|
14 |
ins = '''Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
|
|
30 |
|
31 |
def generate(instruction):
|
32 |
result = ""
|
33 |
+
for x in llm(ins.format(instruction), stop=['### Instruction:', '### End'], stream=True, max_tokens=1024):
|
34 |
result += x['choices'][0]['text']
|
35 |
yield result
|
36 |
|