Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,23 +13,21 @@ st.markdown("Translation Application")
|
|
| 13 |
|
| 14 |
options = ["English","Telugu","Hindi"]
|
| 15 |
|
| 16 |
-
st.
|
| 17 |
|
| 18 |
-
st.selectbox(options)
|
| 19 |
|
| 20 |
-
st.
|
| 21 |
|
| 22 |
-
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
prompt = ChatPromptTemplate.from_messages([("system","you are a good assistant for translation to {il} to {ol}"),
|
| 27 |
("human","{i}")])
|
| 28 |
|
| 29 |
-
chain = prompt|llm
|
| 30 |
|
| 31 |
-
re = chain.invoke({"il":"english","ol":"french", "i":"what is the capital of India"})
|
| 32 |
|
| 33 |
-
st.write(re.content)
|
| 34 |
|
| 35 |
|
|
|
|
| 13 |
|
| 14 |
options = ["English","Telugu","Hindi"]
|
| 15 |
|
| 16 |
+
st.selectbox("Input Langauge: ",options)
|
| 17 |
|
| 18 |
+
st.selectbox("Output langauge: ",options)
|
| 19 |
|
| 20 |
+
if st.button == True:
|
| 21 |
|
| 22 |
+
llm = ChatOpenAI(model = "gpt-3.5-turbo",temperature = 0)
|
| 23 |
|
| 24 |
+
prompt = ChatPromptTemplate.from_messages([("system","you are a good assistant for translation to {il} to {ol}"),
|
|
|
|
|
|
|
| 25 |
("human","{i}")])
|
| 26 |
|
| 27 |
+
chain = prompt|llm
|
| 28 |
|
| 29 |
+
re = chain.invoke({"il":"english","ol":"french", "i":"what is the capital of India"})
|
| 30 |
|
| 31 |
+
st.write(re.content)
|
| 32 |
|
| 33 |
|