Spaces:
Sleeping
Sleeping
Zwea Htet
commited on
Commit
•
8e4a873
1
Parent(s):
2abc521
fixed llms import
Browse files- models/llms.py +21 -20
- pages/llama_custom_demo.py +2 -7
models/llms.py
CHANGED
@@ -6,38 +6,39 @@ import os
|
|
6 |
|
7 |
load_dotenv()
|
8 |
|
9 |
-
llm_mixtral_8x7b = HuggingFaceInferenceAPI(
|
10 |
-
|
11 |
-
|
12 |
-
)
|
13 |
|
14 |
# download the model from the Hugging Face Hub and run it locally
|
15 |
# llm_mixtral_8x7b = HuggingFaceLLM(model_name="mistralai/Mixtral-8x7B-Instruct-v0.1")
|
16 |
|
17 |
-
llm_llama_2_7b_chat = HuggingFaceInferenceAPI(
|
18 |
-
|
19 |
-
|
20 |
-
)
|
21 |
|
22 |
-
llm_bloomz_560m = HuggingFaceInferenceAPI(
|
23 |
-
|
24 |
-
|
25 |
-
)
|
|
|
26 |
|
27 |
-
llm_gpt_3_5_turbo = OpenAI(
|
28 |
-
|
29 |
-
)
|
30 |
|
31 |
llm_gpt_3_5_turbo_0125 = OpenAI(
|
32 |
model="gpt-3.5-turbo-0125",
|
33 |
-
api_key="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",
|
34 |
-
)
|
35 |
-
|
36 |
-
llm_gpt_4_0125 = OpenAI(
|
37 |
-
model="gpt-4-0125-preview",
|
38 |
api_key=os.getenv("OPENAI_API_KEY"),
|
39 |
)
|
40 |
|
|
|
|
|
|
|
|
|
|
|
41 |
llm_llama_13b_v2_replicate = Replicate(
|
42 |
model="meta/llama-2-13b-chat",
|
43 |
prompt_key=os.getenv("REPLICATE_API_KEY"),
|
|
|
6 |
|
7 |
load_dotenv()
|
8 |
|
9 |
+
# llm_mixtral_8x7b = HuggingFaceInferenceAPI(
|
10 |
+
# model_name="mistralai/Mixtral-8x7B-Instruct-v0.1",
|
11 |
+
# token=os.getenv("HUGGINGFACE_API_TOKEN"),
|
12 |
+
# )
|
13 |
|
14 |
# download the model from the Hugging Face Hub and run it locally
|
15 |
# llm_mixtral_8x7b = HuggingFaceLLM(model_name="mistralai/Mixtral-8x7B-Instruct-v0.1")
|
16 |
|
17 |
+
# llm_llama_2_7b_chat = HuggingFaceInferenceAPI(
|
18 |
+
# model_name="meta-llama/Llama-2-7b-chat-hf",
|
19 |
+
# token=os.getenv("HUGGINGFACE_API_TOKEN"),
|
20 |
+
# )
|
21 |
|
22 |
+
# llm_bloomz_560m = HuggingFaceInferenceAPI(
|
23 |
+
# model_name="bigscience/bloomz-560m",
|
24 |
+
# token=os.getenv("HUGGINGFACE_API_TOKEN"),
|
25 |
+
# )
|
26 |
+
llm_bloomz_560m = HuggingFaceLLM(model_name="bigscience/bloomz-560m")
|
27 |
|
28 |
+
# llm_gpt_3_5_turbo = OpenAI(
|
29 |
+
# api_key=os.getenv("OPENAI_API_KEY"),
|
30 |
+
# )
|
31 |
|
32 |
llm_gpt_3_5_turbo_0125 = OpenAI(
|
33 |
model="gpt-3.5-turbo-0125",
|
|
|
|
|
|
|
|
|
|
|
34 |
api_key=os.getenv("OPENAI_API_KEY"),
|
35 |
)
|
36 |
|
37 |
+
# llm_gpt_4_0125 = OpenAI(
|
38 |
+
# model="gpt-4-0125-preview",
|
39 |
+
# api_key=os.getenv("OPENAI_API_KEY"),
|
40 |
+
# )
|
41 |
+
|
42 |
llm_llama_13b_v2_replicate = Replicate(
|
43 |
model="meta/llama-2-13b-chat",
|
44 |
prompt_key=os.getenv("REPLICATE_API_KEY"),
|
pages/llama_custom_demo.py
CHANGED
@@ -5,13 +5,8 @@ import os
|
|
5 |
import pathlib
|
6 |
from typing import List
|
7 |
from models.llms import (
|
8 |
-
llm_llama_2_7b_chat,
|
9 |
-
llm_mixtral_8x7b,
|
10 |
llm_bloomz_560m,
|
11 |
-
llm_gpt_3_5_turbo,
|
12 |
llm_gpt_3_5_turbo_0125,
|
13 |
-
llm_gpt_4_0125,
|
14 |
-
llm_llama_13b_v2_replicate,
|
15 |
)
|
16 |
from models.embeddings import hf_embed_model, openai_embed_model
|
17 |
from models.llamaCustom import LlamaCustom
|
@@ -37,8 +32,8 @@ Settings.embed_model = hf_embed_model
|
|
37 |
|
38 |
llama_llms = {
|
39 |
"bigscience/bloomz-560m": llm_bloomz_560m,
|
40 |
-
"mistral/mixtral": llm_mixtral_8x7b,
|
41 |
-
"meta-llama/Llama-2-7b-chat-hf": llm_llama_2_7b_chat,
|
42 |
# "openai/gpt-3.5-turbo": llm_gpt_3_5_turbo,
|
43 |
"openai/gpt-3.5-turbo-0125": llm_gpt_3_5_turbo_0125,
|
44 |
# "openai/gpt-4-0125-preview": llm_gpt_4_0125,
|
|
|
5 |
import pathlib
|
6 |
from typing import List
|
7 |
from models.llms import (
|
|
|
|
|
8 |
llm_bloomz_560m,
|
|
|
9 |
llm_gpt_3_5_turbo_0125,
|
|
|
|
|
10 |
)
|
11 |
from models.embeddings import hf_embed_model, openai_embed_model
|
12 |
from models.llamaCustom import LlamaCustom
|
|
|
32 |
|
33 |
llama_llms = {
|
34 |
"bigscience/bloomz-560m": llm_bloomz_560m,
|
35 |
+
# "mistral/mixtral": llm_mixtral_8x7b,
|
36 |
+
# "meta-llama/Llama-2-7b-chat-hf": llm_llama_2_7b_chat,
|
37 |
# "openai/gpt-3.5-turbo": llm_gpt_3_5_turbo,
|
38 |
"openai/gpt-3.5-turbo-0125": llm_gpt_3_5_turbo_0125,
|
39 |
# "openai/gpt-4-0125-preview": llm_gpt_4_0125,
|