Spaces:
Runtime error
Runtime error
Commit
·
4cb6632
1
Parent(s):
fd747e7
Update app.py
Browse files
app.py
CHANGED
@@ -6,14 +6,14 @@ from langchain import LLMChain, HuggingFacePipeline, PromptTemplate
|
|
6 |
import os
|
7 |
from ctransformers import AutoModelForCausalLM, AutoTokenizer
|
8 |
|
9 |
-
model = AutoModelForCausalLM.from_pretrained("marella/gpt-2-ggml", hf=True)
|
10 |
-
tokenizer = AutoTokenizer.from_pretrained(model)
|
11 |
|
12 |
access_token = os.getenv("Llama2")
|
13 |
|
14 |
def greet(text):
|
15 |
|
16 |
-
model = AutoModelForCausalLM.from_pretrained("
|
17 |
tokenizer = AutoTokenizer.from_pretrained(model)
|
18 |
|
19 |
# model = "meta-llama/Llama-2-7b-hf"
|
@@ -35,7 +35,7 @@ def greet(text):
|
|
35 |
# token=access_token
|
36 |
)
|
37 |
|
38 |
-
llm = HuggingFacePipeline(pipeline = pipeline, model_kwargs = {'temperature':0
|
39 |
|
40 |
template = """Write a concise summary of the following:
|
41 |
"{text}"
|
|
|
6 |
import os
|
7 |
from ctransformers import AutoModelForCausalLM, AutoTokenizer
|
8 |
|
9 |
+
# model = AutoModelForCausalLM.from_pretrained("marella/gpt-2-ggml", hf=True)
|
10 |
+
# tokenizer = AutoTokenizer.from_pretrained(model)
|
11 |
|
12 |
access_token = os.getenv("Llama2")
|
13 |
|
14 |
def greet(text):
|
15 |
|
16 |
+
model = AutoModelForCausalLM.from_pretrained("TheBloke/Llama-2-7B-Chat-GGML", model_file = 'llama-2-7b-chat.ggmlv3.q4_K_S.bin', hf=True)
|
17 |
tokenizer = AutoTokenizer.from_pretrained(model)
|
18 |
|
19 |
# model = "meta-llama/Llama-2-7b-hf"
|
|
|
35 |
# token=access_token
|
36 |
)
|
37 |
|
38 |
+
llm = HuggingFacePipeline(pipeline = pipeline, model_kwargs = {'temperature':0,'repetition_penalty':1.1})
|
39 |
|
40 |
template = """Write a concise summary of the following:
|
41 |
"{text}"
|