Update app.py
Browse files
app.py
CHANGED
@@ -86,3 +86,65 @@ if st.button("Summerize "):
|
|
86 |
result = summarize_document_chain.run(text)
|
87 |
st.write(result)
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
result = summarize_document_chain.run(text)
|
87 |
st.write(result)
|
88 |
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
+
yourquestion = st.text_input('Your topic', 'netzero')
|
93 |
+
st.write('Your input is ', yourquestion)
|
94 |
+
|
95 |
+
if st.button("Ask French "):
|
96 |
+
template = """
|
97 |
+
You are an expert on topics of Sustainability, Climate action and UN Sustainable Development Goals.
|
98 |
+
Explain the concept of {concept} like i am a five in French
|
99 |
+
"""
|
100 |
+
|
101 |
+
prompt = PromptTemplate(
|
102 |
+
input_variables=["concept"],
|
103 |
+
template=template,
|
104 |
+
)
|
105 |
+
|
106 |
+
|
107 |
+
from langchain.chains import LLMChain
|
108 |
+
chain = LLMChain(llm=llm, prompt=prompt)
|
109 |
+
|
110 |
+
# Run the chain only specifying the input variable.
|
111 |
+
st.write(chain.run(yourquestion))
|
112 |
+
|
113 |
+
|
114 |
+
if st.button("Ask English "):
|
115 |
+
template = """
|
116 |
+
You are an expert on topics of Sustainability, Climate action and UN Sustainable Development Goals.
|
117 |
+
Explain the concept of {concept} like i am a five
|
118 |
+
"""
|
119 |
+
|
120 |
+
prompt = PromptTemplate(
|
121 |
+
input_variables=["concept"],
|
122 |
+
template=template,
|
123 |
+
)
|
124 |
+
|
125 |
+
|
126 |
+
from langchain.chains import LLMChain
|
127 |
+
chain = LLMChain(llm=llm, prompt=prompt)
|
128 |
+
|
129 |
+
# Run the chain only specifying the input variable.
|
130 |
+
st.write(chain.run(yourquestion))
|
131 |
+
|
132 |
+
|
133 |
+
|
134 |
+
if st.button("Ask Hindi "):
|
135 |
+
template = """
|
136 |
+
You are an expert on topics of Sustainability, Climate action and UN Sustainable Development Goals.
|
137 |
+
Explain the concept of {concept} in Hindi
|
138 |
+
"""
|
139 |
+
|
140 |
+
prompt = PromptTemplate(
|
141 |
+
input_variables=["concept"],
|
142 |
+
template=template,
|
143 |
+
)
|
144 |
+
|
145 |
+
|
146 |
+
from langchain.chains import LLMChain
|
147 |
+
chain = LLMChain(llm=llm, prompt=prompt)
|
148 |
+
|
149 |
+
# Run the chain only specifying the input variable.
|
150 |
+
st.write(chain.run(yourquestion))
|