yxmauw commited on
Commit
02fc79d
1 Parent(s): 1648488

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 gpt4all import GPT4All
3
+
4
+ model = GPT4All("orca-mini-3b-gguf2-q4_0.gguf")
5
+
6
+ def generate_text(input_text):
7
+ output = model.generate(input_text, max_tokens=50)
8
+ generated_text = output["text"]
9
+ return generated_text
10
+
11
+ input_text = gr.Textbox(lines=5, label="Input Text")
12
+ output_text = gr.Textbox(lines=5, label="Generated Text")
13
+
14
+ gr.Interface(fn=generate_text, inputs=input_text, outputs=output_text, title="GPT4All_experiment").launch()