File size: 652 Bytes
22e1d30
c97127b
 
97fe032
22e1d30
c97127b
 
97fe032
22e1d30
 
cd1328b
c8eb315
22e1d30
97fe032
d21d50a
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr
from llama_cpp import Llama
from huggingface_hub import hf_hub_download
import multiprocessing

hf_hub_download(repo_id="LLukas22/gpt4all-lora-quantized-ggjt", filename="ggjt-model.bin", local_dir=".")

llm = Llama(model_path="./ggjt-model.bin", n_threads=multiprocessing.cpu_count())

def chat(input):
    resp = llm(input)
    return resp['choices'][0]['text']

g = gr.Interface(fn=chat, inputs="text", outputs="text", title="GPT4ALL", description="gpt4all: an ecosystem of open-source chatbots trained on a massive collections of clean assistant data including code, stories and dialogue")
g.queue(concurrency_count=1)
g.launch()