Spaces:
Runtime error
Runtime error
Sharathhebbar24
commited on
Commit
•
4463bb5
1
Parent(s):
5580b5a
Update app.py
Browse files
app.py
CHANGED
@@ -82,13 +82,22 @@ class LLM_Langchain():
|
|
82 |
|
83 |
def generate_response(self, input_text):
|
84 |
|
85 |
-
|
86 |
llm = HuggingFaceHub(
|
87 |
repo_id = self.model_name,
|
88 |
model_kwargs = self.model_kwargs
|
89 |
)
|
90 |
-
|
91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
|
94 |
def radio_button(self):
|
|
|
82 |
|
83 |
def generate_response(self, input_text):
|
84 |
|
85 |
+
template = "<|system|>\nYou are a intelligent chatbot.</s>\n<|user|>\n{input_text}.\n<|assistant|>"
|
86 |
llm = HuggingFaceHub(
|
87 |
repo_id = self.model_name,
|
88 |
model_kwargs = self.model_kwargs
|
89 |
)
|
90 |
+
llm_chain = LLMChain(
|
91 |
+
prompt=template,
|
92 |
+
llm=llm,
|
93 |
+
)
|
94 |
+
|
95 |
+
result = llm_chain.run({
|
96 |
+
"question": input_text,
|
97 |
+
# "context": context
|
98 |
+
})
|
99 |
+
# return llm(input_text)
|
100 |
+
return result
|
101 |
|
102 |
|
103 |
def radio_button(self):
|