Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -55,9 +55,7 @@ memory = ConversationBufferWindowMemory()
|
|
55 |
|
56 |
|
57 |
# Update the model path to use the Hugging Face model identifier
|
58 |
-
llm = CTransformers(model='MD1998/
|
59 |
-
# model_file='llama-2-7b-chat.ggmlv3.q3_K_S.bin',
|
60 |
-
# model_type='llama',
|
61 |
config={'max_new_tokens': 25,
|
62 |
'temperature': 0.2}
|
63 |
)
|
@@ -70,15 +68,13 @@ llm = CTransformers(model='MD1998/FLAN-T5-V1',
|
|
70 |
|
71 |
def greet(my_prompt):
|
72 |
|
73 |
-
B_INST, E_INST = "[INST]", "[/INST]"
|
74 |
-
B_SYS, E_SYS = "<<SYS>>\n", "\n<</SYS>>\n\n"
|
75 |
|
76 |
DEFAULT_SYSTEM_PROMPT="""\
|
77 |
You are a helpful, respectful, and honest assistant designed to improve English language skills. Always provide accurate and helpful responses to language improvement tasks, while ensuring safety and ethical standards. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased, positive, and focused on enhancing language skills.
|
78 |
|
79 |
If a question does not make sense or is not factually coherent, explain why instead of answering something incorrect. If you don't know the answer to a question, please don't share false information.
|
80 |
|
81 |
-
Your role is to guide users through various language exercises and challenges, helping them to practice and improve their English skills in a fun and engaging way. Always encourage users to try different approaches and provide constructive feedback to help them progress.
|
82 |
"""
|
83 |
|
84 |
|
@@ -94,12 +90,9 @@ def greet(my_prompt):
|
|
94 |
# instruction = "Convert the following text from English to French: \n\n {text}"
|
95 |
instruction = "Have a good conversation: \n\n {text}"
|
96 |
|
97 |
-
SYSTEM_PROMPT = B_SYS + DEFAULT_SYSTEM_PROMPT + E_SYS
|
98 |
|
99 |
-
|
100 |
-
|
101 |
-
# print(template)
|
102 |
-
prompt = PromptTemplate(template=template, input_variables=["text"])
|
103 |
|
104 |
|
105 |
LLM_Chain = LLMChain(prompt=prompt, llm=llm, memory=memory)
|
|
|
55 |
|
56 |
|
57 |
# Update the model path to use the Hugging Face model identifier
|
58 |
+
llm = CTransformers(model='MD1998/chating_beginners_v1',
|
|
|
|
|
59 |
config={'max_new_tokens': 25,
|
60 |
'temperature': 0.2}
|
61 |
)
|
|
|
68 |
|
69 |
def greet(my_prompt):
|
70 |
|
|
|
|
|
71 |
|
72 |
DEFAULT_SYSTEM_PROMPT="""\
|
73 |
You are a helpful, respectful, and honest assistant designed to improve English language skills. Always provide accurate and helpful responses to language improvement tasks, while ensuring safety and ethical standards. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased, positive, and focused on enhancing language skills.
|
74 |
|
75 |
If a question does not make sense or is not factually coherent, explain why instead of answering something incorrect. If you don't know the answer to a question, please don't share false information.
|
76 |
|
77 |
+
Your role is to guide users through various language exercises and challenges, helping them to practice and improve their English skills in a fun and engaging way. Always encourage users to try different approaches and provide constructive feedback to help them progress. \n\n {text}
|
78 |
"""
|
79 |
|
80 |
|
|
|
90 |
# instruction = "Convert the following text from English to French: \n\n {text}"
|
91 |
instruction = "Have a good conversation: \n\n {text}"
|
92 |
|
|
|
93 |
|
94 |
+
|
95 |
+
prompt = PromptTemplate(template=DEFAULT_SYSTEM_PROMPT, input_variables=["text"])
|
|
|
|
|
96 |
|
97 |
|
98 |
LLM_Chain = LLMChain(prompt=prompt, llm=llm, memory=memory)
|