zeyadahmedd commited on
Commit
8b21e33
1 Parent(s): 906cbc2

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -41
app.py DELETED
@@ -1,41 +0,0 @@
1
- import gradio as gr
2
- from langchain import PromptTemplate, LlamaCpp, LLMChain, FAISS
3
- from langchain.callbacks import StreamingStdOutCallbackHandler
4
- from langchain.callbacks.manager import CallbackManager
5
- from langchain.chains.question_answering import load_qa_chain
6
- import dill
7
- def greet(name):
8
- db = dill.load(open("client_embebedings.mate", "rb"))
9
- #return name+db
10
- docs = db.similarity_search(name)
11
- return chain.run(input_documents=docs, question=name)
12
-
13
- def greet1(name):
14
- return "Hello ya client" +name
15
-
16
- iface = gr.Blocks()
17
-
18
- with iface:
19
- callback_manager = CallbackManager([StreamingStdOutCallbackHandler()])
20
- chain = load_qa_chain( LlamaCpp(
21
- model_path="llama-13B-Q4_K_M.gguf",
22
- temperature=0,
23
- top_p= 1,
24
- callback_manager=callback_manager,
25
- verbose=True,
26
- n_ctx=8169,
27
-
28
- ), chain_type="stuff")
29
- name = gr.Textbox(label="Name")
30
- output = gr.Textbox(label="Output Box")
31
-
32
- greet_btn = gr.Button("Greet")
33
- greet_btn.click(fn=greet, inputs=name, outputs=output, api_name="greet")
34
-
35
- greet1_btn = gr.Button("Greet1")
36
- greet1_btn.click(fn=greet1, inputs=name, outputs=output, api_name="testing")
37
-
38
- iface.launch()
39
-
40
-
41
-