Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,7 @@ from langchain_openai import OpenAI
|
|
| 17 |
#Function to return the response
|
| 18 |
def load_answer(question):
|
| 19 |
# "text-davinci-003" model is depreciated, so using the latest one https://platform.openai.com/docs/deprecations
|
| 20 |
-
llm = OpenAI(model_name="gpt-3.5-turbo
|
| 21 |
|
| 22 |
#Last week langchain has recommended to use invoke function for the below please :)
|
| 23 |
answer=llm.invoke(question)
|
|
@@ -25,8 +25,8 @@ def load_answer(question):
|
|
| 25 |
|
| 26 |
|
| 27 |
#App UI starts here
|
| 28 |
-
st.set_page_config(page_title="
|
| 29 |
-
st.header("
|
| 30 |
|
| 31 |
#Gets the user input
|
| 32 |
def get_text():
|
|
@@ -35,7 +35,7 @@ def get_text():
|
|
| 35 |
|
| 36 |
|
| 37 |
user_input=get_text()
|
| 38 |
-
response = load_answer(user_input)
|
| 39 |
|
| 40 |
submit = st.button('Generate')
|
| 41 |
|
|
|
|
| 17 |
#Function to return the response
|
| 18 |
def load_answer(question):
|
| 19 |
# "text-davinci-003" model is depreciated, so using the latest one https://platform.openai.com/docs/deprecations
|
| 20 |
+
llm = OpenAI(model_name="gpt-3.5-turbo",temperature=0)
|
| 21 |
|
| 22 |
#Last week langchain has recommended to use invoke function for the below please :)
|
| 23 |
answer=llm.invoke(question)
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
#App UI starts here
|
| 28 |
+
st.set_page_config(page_title="Python Code Optimiser", page_icon=":robot:")
|
| 29 |
+
st.header("Provide a function to optimise")
|
| 30 |
|
| 31 |
#Gets the user input
|
| 32 |
def get_text():
|
|
|
|
| 35 |
|
| 36 |
|
| 37 |
user_input=get_text()
|
| 38 |
+
response = load_answer("Optimise the below function for better time complexity and also share the improvement in time notation\n"+user_input)
|
| 39 |
|
| 40 |
submit = st.button('Generate')
|
| 41 |
|