Spaces:
Runtime error
Runtime error
Commit
·
7326090
1
Parent(s):
3cfcf03
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,15 +48,16 @@ def predict(text):
|
|
| 48 |
ampli-energy it is mainly works for Full of energy, like you, ampli-easy it is mainly works for Allow yourself to hear well.
|
| 49 |
You can also be creative, funny, or show emotions at time.
|
| 50 |
also share the book a appointment link of your company https://www.amplifon.com/uk/book-an-appointment
|
| 51 |
-
|
| 52 |
Question: {question}
|
| 53 |
Product details:"""
|
| 54 |
PROMPT = PromptTemplate(
|
| 55 |
-
template=prompt_template, input_variables=["
|
| 56 |
)
|
| 57 |
chain_type_kwargs = {"prompt": PROMPT}
|
| 58 |
# qa = RetrievalQA.from_chain_type(llm=OpenAI(), chain_type="stuff", retriever=docsearch.as_retriever(), chain_type_kwargs=chain_type_kwargs)
|
| 59 |
|
|
|
|
| 60 |
|
| 61 |
llm = OpenAI()
|
| 62 |
# prompt = PromptTemplate(
|
|
@@ -64,7 +65,7 @@ Product details:"""
|
|
| 64 |
# template="What is a good name for a company that makes {product}?",
|
| 65 |
# )
|
| 66 |
chain = LLMChain(llm=llm, prompt=PROMPT)
|
| 67 |
-
resp = chain.run(
|
| 68 |
print(resp)
|
| 69 |
|
| 70 |
# response = []
|
|
|
|
| 48 |
ampli-energy it is mainly works for Full of energy, like you, ampli-easy it is mainly works for Allow yourself to hear well.
|
| 49 |
You can also be creative, funny, or show emotions at time.
|
| 50 |
also share the book a appointment link of your company https://www.amplifon.com/uk/book-an-appointment
|
| 51 |
+
|
| 52 |
Question: {question}
|
| 53 |
Product details:"""
|
| 54 |
PROMPT = PromptTemplate(
|
| 55 |
+
template=prompt_template, input_variables=["question"]
|
| 56 |
)
|
| 57 |
chain_type_kwargs = {"prompt": PROMPT}
|
| 58 |
# qa = RetrievalQA.from_chain_type(llm=OpenAI(), chain_type="stuff", retriever=docsearch.as_retriever(), chain_type_kwargs=chain_type_kwargs)
|
| 59 |
|
| 60 |
+
#Actually, Hi, how are you doing? Actually, I am looking for the hearing aid for my grandfather. He has like age around 62, 65 year old and one of the like major thing that I am looking for the hearing aid product which is like maximum comfort. So if you have anything in that category, so can you please tell me? Thank you.
|
| 61 |
|
| 62 |
llm = OpenAI()
|
| 63 |
# prompt = PromptTemplate(
|
|
|
|
| 65 |
# template="What is a good name for a company that makes {product}?",
|
| 66 |
# )
|
| 67 |
chain = LLMChain(llm=llm, prompt=PROMPT)
|
| 68 |
+
resp = chain.run(question=text)
|
| 69 |
print(resp)
|
| 70 |
|
| 71 |
# response = []
|