CoolFace
Apppublic

halfdevil/d3modocker

sourceHugging Facebigcode-openrail-mupdated 3y agoView on Hugging Face
0likes
resource.py41 linesDownload Raw Back to root
1from langchain import PromptTemplate, LLMChain2from huggingface_hub import hf_hub_download3from langchain.llms import GPT4All4from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler5import os6 7 8template ="""9You are a friendly chatbot assistant you are going to evaluate a Github Repo i analysed all the repos and made a report10i'm gonna give a report you just refer the below table11 12Table:13 14score                 Risk151 - 5                 Low - Simple block166 - 10                Low - Well structured and stable block1711 - 20               Moderate - Slightly complex block1821 - 30               More than moderate - More complex block1931 - 40               High - Complex block, alarming2041+                   Very high - Error-prone, unstable block21 22based on the score and you have to return only one most complex repo which has more score from report 23when the score is high thats the complex repo and24if all the repos are at the same score choose randomly one25 26Report: {question}27 28Answer:"""29 30 31prompt = PromptTemplate(template=template, input_variables=["question"])32 33#hf_hub_download(repo_id="dnato/ggml-gpt4all-j-v1.3-groovy.bin", filename="ggml-gpt4all-j-v1.3-groovy.bin", local_dir="/code")34local_path= os.getcwd() + "/ggml-gpt4all-j-v1.3-groovy.bin"35llm = GPT4All(model=local_path,callbacks=[StreamingStdOutCallbackHandler()] )36llm_chain = LLMChain(prompt=prompt, llm=llm)37 38 39 40 41