Update app.py
Browse files
app.py
CHANGED
@@ -7,15 +7,13 @@ hftoken = os.environ["hftoken"]
|
|
7 |
from langchain_huggingface import HuggingFaceEndpoint
|
8 |
|
9 |
# repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
|
10 |
-
repo_id = "google/gemma-2-9b-it"
|
|
|
11 |
llm = HuggingFaceEndpoint(repo_id = repo_id, max_new_tokens = 128, temperature = 0.7, huggingfacehub_api_token = hftoken)
|
12 |
|
13 |
from langchain_core.output_parsers import StrOutputParser
|
14 |
from langchain_core.prompts import ChatPromptTemplate
|
15 |
|
16 |
-
prompt = ChatPromptTemplate.from_template("tell me a joke about {topic}")
|
17 |
-
chain = prompt | llm | StrOutputParser()
|
18 |
-
|
19 |
# from langchain.document_loaders.csv_loader import CSVLoader
|
20 |
from langchain_community.document_loaders.csv_loader import CSVLoader
|
21 |
|
|
|
7 |
from langchain_huggingface import HuggingFaceEndpoint
|
8 |
|
9 |
# repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
|
10 |
+
# repo_id = "google/gemma-2-9b-it"
|
11 |
+
repo_id = "meta-llama/Meta-Llama-3-8B-Instruct"
|
12 |
llm = HuggingFaceEndpoint(repo_id = repo_id, max_new_tokens = 128, temperature = 0.7, huggingfacehub_api_token = hftoken)
|
13 |
|
14 |
from langchain_core.output_parsers import StrOutputParser
|
15 |
from langchain_core.prompts import ChatPromptTemplate
|
16 |
|
|
|
|
|
|
|
17 |
# from langchain.document_loaders.csv_loader import CSVLoader
|
18 |
from langchain_community.document_loaders.csv_loader import CSVLoader
|
19 |
|