Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from llama_cpp import Llama
|
|
7 |
from huggingface_hub import hf_hub_download #load from huggingfaces
|
8 |
|
9 |
|
10 |
-
llm = Llama(model_path= hf_hub_download(repo_id="TheBloke/
|
11 |
|
12 |
history = []
|
13 |
|
@@ -17,7 +17,7 @@ def generate_text(input_text, history):
|
|
17 |
if history == []:
|
18 |
input_text_with_history = f"Q: {input_text} \n A:"
|
19 |
else:
|
20 |
-
input_text_with_history = history[-1][1]+ "\n"
|
21 |
input_text_with_history += f"Q: {input_text} \n A:"
|
22 |
print("new input", input_text_with_history)
|
23 |
output = llm(input_text_with_history, max_tokens=1024, stop=["Q:", "\n"], stream=True)
|
|
|
7 |
from huggingface_hub import hf_hub_download #load from huggingfaces
|
8 |
|
9 |
|
10 |
+
llm = Llama(model_path= hf_hub_download(repo_id="TheBloke/orca_mini_3B-GGML", filename="orca-mini-3b.ggmlv3.q4_1.bin"), n_ctx=2048) #download model from hf/ n_ctx=2048 for high ccontext length
|
11 |
|
12 |
history = []
|
13 |
|
|
|
17 |
if history == []:
|
18 |
input_text_with_history = f"Q: {input_text} \n A:"
|
19 |
else:
|
20 |
+
input_text_with_history = f"{history[-1][1]}"+ "\n"
|
21 |
input_text_with_history += f"Q: {input_text} \n A:"
|
22 |
print("new input", input_text_with_history)
|
23 |
output = llm(input_text_with_history, max_tokens=1024, stop=["Q:", "\n"], stream=True)
|