chetanVarma commited on
Commit
12e1e3a
1 Parent(s): 9b34cf3
Files changed (1) hide show
  1. app.py +20 -20
app.py CHANGED
@@ -1,20 +1,20 @@
1
- from langchain_community.llms import OpenAI
2
- from dotenv import load_dotenv
3
- load_dotenv()
4
- import streamlit as st
5
- import os
6
- def get_openai_res(question):
7
- llm= OpenAI(openai_api_key=os.getenv("OPENAI_API_KEY"),model_name="davinci-002",temperature=0.5)
8
- response = llm(question)
9
- return response
10
-
11
- st.set_page_config(page_title="Q&A Demo")
12
-
13
- st.header("Langchain Application")
14
- input = st.text_input("Input :",key="input")
15
- response = get_openai_res(input)
16
- submit = st.button("Ask the Question")
17
-
18
- if submit:
19
- st.subheader("The Response is ")
20
- st.write(response)
 
1
+ from langchain.llms import OpenAI
2
+ from dotenv import load_dotenv
3
+ load_dotenv()
4
+ import streamlit as st
5
+ import os
6
+ def get_openai_res(question):
7
+ llm= OpenAI(openai_api_key=os.getenv("OPENAI_API_KEY"),model_name="davinci-002",temperature=0.5)
8
+ response = llm(question)
9
+ return response
10
+
11
+ st.set_page_config(page_title="Q&A Demo")
12
+
13
+ st.header("Langchain Application")
14
+ input = st.text_input("Input :",key="input")
15
+ response = get_openai_res(input)
16
+ submit = st.button("Ask the Question")
17
+
18
+ if submit:
19
+ st.subheader("The Response is ")
20
+ st.write(response)