File size: 643 Bytes
8a97208
4789c94
8272482
4789c94
0dc8b0f
319b4d3
4789c94
 
319b4d3
402975e
4789c94
 
319b4d3
0010001
8a97208
0010001
 
 
eb443cd
 
4789c94
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline

# # Specify the directory containing the tokenizer's configuration file (config.json)
model_name = "wizardlm-13b-v1.1-superhot-8k.ggmlv3.q4_0.bin"

# # Initialize the GPT4All model
model = AutoModelForCausalLM.from_pretrained(model_name)

def generate_text(input_text):
	text= model.generate(input_text)
	return text

text_generation_interface = gr.Interface(
    fn=generate_text,
    inputs=[
        gr.inputs.Textbox(label="Input Text"),
    ],
    outputs=gr.outputs.Textbox(label="Generated Text"),
    title="GPT-4 Text Generation",
).launch()