Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -36,12 +36,12 @@ routes.get_types = get_types
|
|
36 |
hf_hub_download(repo_id='StarFox7/Llama-2-ko-7B-chat-gguf', filename='Llama-2-ko-7B-chat-gguf-q4_0.bin', local_dir='./')
|
37 |
|
38 |
llm = Llama(model_path = 'Llama-2-ko-7B-chat-gguf-q4_0.bin',
|
39 |
-
n_ctx=
|
40 |
)
|
41 |
# App code
|
42 |
def chat(x):
|
43 |
-
output = llm(f"๋ค์์ A์ B์ ์ญํ ๊ทน์ด์ผ. ๋๋ B์ผ. A์ ๋ํํ๊ณ ์์ด. ์น๊ตฌ์๊ฒ ์น๊ทผํ๊ณ ๊ฐ๊ฒฐํ๊ฒ ์ ๋๋ตํด์ค.\n\n### A:\n{x}\n\n### B:\n", max_tokens=
|
44 |
-
return output['choices'][0]['text']
|
45 |
|
46 |
|
47 |
with gr.Blocks() as demo:
|
|
|
36 |
hf_hub_download(repo_id='StarFox7/Llama-2-ko-7B-chat-gguf', filename='Llama-2-ko-7B-chat-gguf-q4_0.bin', local_dir='./')
|
37 |
|
38 |
llm = Llama(model_path = 'Llama-2-ko-7B-chat-gguf-q4_0.bin',
|
39 |
+
n_ctx=512,
|
40 |
)
|
41 |
# App code
|
42 |
def chat(x):
|
43 |
+
output = llm(f"๋ค์์ A์ B์ ์ญํ ๊ทน์ด์ผ. ๋๋ B์ผ. A์ ๋ํํ๊ณ ์์ด. ์น๊ตฌ์๊ฒ ์น๊ทผํ๊ณ ๊ฐ๊ฒฐํ๊ฒ ์ ๋๋ตํด์ค.\n\n### A:\n{x}\n\n### B:\n", max_tokens=20, stop=["###"], echo=True)
|
44 |
+
return output['choices'][0]['text'][len("๋ค์์ A์ B์ ์ญํ ๊ทน์ด์ผ. ๋๋ B์ผ. A์ ๋ํํ๊ณ ์์ด. ์น๊ตฌ์๊ฒ ์น๊ทผํ๊ณ ๊ฐ๊ฒฐํ๊ฒ ์ ๋๋ตํด์ค."):-1]
|
45 |
|
46 |
|
47 |
with gr.Blocks() as demo:
|