varun500 commited on
Commit
09cd764
·
1 Parent(s): 3557e78

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +29 -0
  2. ggml-vic13b-uncensored-q4_0.bin +3 -0
  3. requirements.txt +1 -0
app.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ os.system('CMAKE_ARGS="-DLLAMA_OPENBLAS=on" FORCE_CMAKE=1 pip install llama-cpp-python')
3
+
4
+ import gradio as gr
5
+ from llama_cpp import Llama
6
+
7
+
8
+ llm = Llama(model_path="eachadea_ggml-vic7b-q4_0.bin", n_ctx=2048, n_batch=126)
9
+
10
+ def generate_text(prompt):
11
+ output = llm(prompt, max_tokens=468, temperature=0.1, top_p=0.5, echo=False, stop=["#"])
12
+ output_text = output['choices'][0]['text']
13
+ return output_text
14
+
15
+ description = "Vicuna-7B-GPTQ-4bit-128g.GGML, max_tokens=468, temperature=0.1, top_p=0.5"
16
+
17
+ examples = [
18
+ ["What is the capital of France? ", "The capital of France is Paris."],
19
+ ["Who wrote the novel 'Pride and Prejudice'?", "The novel 'Pride and Prejudice' was written by Jane Austen."],
20
+ ["What is the square root of 64?", "The square root of 64 is 8."]
21
+ ]
22
+
23
+ gradio_interface = gr.Interface(
24
+ fn=generate_text,
25
+ inputs="text",
26
+ outputs="text",
27
+ title="Vicuna API",
28
+ )
29
+ gradio_interface.launch()
ggml-vic13b-uncensored-q4_0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:511a3087e894bee221c01d384b2bc628c42b64404b3f09a660f77841427631df
3
+ size 8136770688
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ #llama-cpp-python==0.1.50