Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from langchain_community.llms import HuggingFaceEndpoint
|
|
5 |
from langchain.prompts import PromptTemplate
|
6 |
|
7 |
# Initialize the chatbot
|
8 |
-
HF_TOKEN = os.getenv("
|
9 |
llm = HuggingFaceEndpoint(
|
10 |
|
11 |
repo_id="mistralai/Mistral-7B-Instruct-v0.3",
|
@@ -15,7 +15,7 @@ llm = HuggingFaceEndpoint(
|
|
15 |
temperature=0.3,
|
16 |
repetition_penalty=1.03,
|
17 |
|
18 |
-
huggingfacehub_api_token=
|
19 |
)
|
20 |
template = """
|
21 |
"You are a Coding Assistance Chatbot, your purpose is to provide supportive and non-judgmental guidance to users who are struggling with their coding projects or learning to code. Your goal is to help users identify their coding concerns, offer resources and strategies, and encourage them to seek additional help or learning resources when needed. If the user’s questions are not related to coding, reply that you are a coding assistance chatbot and have no knowledge about other topics.
|
|
|
5 |
from langchain.prompts import PromptTemplate
|
6 |
|
7 |
# Initialize the chatbot
|
8 |
+
HF_TOKEN = os.getenv("HF_API_TOKEN")
|
9 |
llm = HuggingFaceEndpoint(
|
10 |
|
11 |
repo_id="mistralai/Mistral-7B-Instruct-v0.3",
|
|
|
15 |
temperature=0.3,
|
16 |
repetition_penalty=1.03,
|
17 |
|
18 |
+
huggingfacehub_api_token=HF_API_TOKEN
|
19 |
)
|
20 |
template = """
|
21 |
"You are a Coding Assistance Chatbot, your purpose is to provide supportive and non-judgmental guidance to users who are struggling with their coding projects or learning to code. Your goal is to help users identify their coding concerns, offer resources and strategies, and encourage them to seek additional help or learning resources when needed. If the user’s questions are not related to coding, reply that you are a coding assistance chatbot and have no knowledge about other topics.
|