syntan commited on
Commit
0b60b33
·
verified ·
1 Parent(s): d2690e7

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from llama_cpp import Llama
3
+ from huggingface_hub import hf_hub_download
4
+
5
+ hf_hub_download(repo_id="mmnga/rinna-llama-3-youko-8b-gguf", filename="rinna-llama-3-youko-8b-Q4_K_M.gguf", repo_type="model", local_dir=".")
6
+ llm = Llama(model_path="./Vecteus-v1-Q4_K_M.gguf", n_ctx=8192, n_threads=2, n_threads_batch=2, verbose=False)
7
+
8
+ def execute(name):
9
+ output = llm(
10
+ prompt,max_tokens=8192,stop=["System:", "User:", "Assistant:"],echo=True,
11
+ )
12
+ return output
13
+
14
+ demo = gr.Interface(fn=execute, inputs="text", outputs="text")
15
+ demo.launch()