Spaces:
Sleeping
Sleeping
matthewfarant
commited on
Commit
•
aa8d6ff
1
Parent(s):
a3b5df7
Update app.py
Browse files
app.py
CHANGED
@@ -23,16 +23,18 @@ os.environ["GOOGLE_CSE_ID"] = os.getenv('GOOGLE_CSE_ID')
|
|
23 |
os.environ["GOOGLE_API_KEY"] = os.getenv('GOOGLE_API_KEY')
|
24 |
|
25 |
# Llama Endpoint
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
36 |
|
37 |
llama3 = ChatHuggingFace(llm=llm, temperature = 1)
|
38 |
llama3_json = ChatHuggingFace(llm=llm, format = 'json', temperature = 0)
|
|
|
23 |
os.environ["GOOGLE_API_KEY"] = os.getenv('GOOGLE_API_KEY')
|
24 |
|
25 |
# Llama Endpoint
|
26 |
+
llm = HuggingFaceEndpoint(
|
27 |
+
repo_id="meta-llama/Meta-Llama-3.1-8B-Instruct",
|
28 |
+
task="text-generation",
|
29 |
+
max_new_tokens = 4000,
|
30 |
+
max_length = 4000,
|
31 |
+
do_sample = False,
|
32 |
+
repetition_penalty = 1.03,
|
33 |
+
huggingfacehub_api_token = os.getenv('HF_KEY')
|
34 |
+
)
|
35 |
+
|
36 |
+
# pipe = pipeline("text-generation", model="meta-llama/Meta-Llama-3.1-8B-Instruct", token = os.getenv('HF_KEY'))
|
37 |
+
# llm = HuggingFacePipeline(pipeline=pipe)
|
38 |
|
39 |
llama3 = ChatHuggingFace(llm=llm, temperature = 1)
|
40 |
llama3_json = ChatHuggingFace(llm=llm, format = 'json', temperature = 0)
|