shubhamrooter commited on
Commit
7440017
·
verified ·
1 Parent(s): e7fed08

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from llama_cpp import Llama
3
+
4
+ def load_model():
5
+ model_path = "mradermacher/Pentesting-GPT-v1.0-GGUF/resolve/main/model-file.q4_k_m.gguf"
6
+ llm = Llama(model_path=model_path)
7
+ return llm
8
+
9
+ def respond(message, history):
10
+ llm = load_model()
11
+ output = llm(message, max_tokens=100)
12
+ return output['choices'][0]['text']
13
+
14
+ gr.ChatInterface(respond).launch()