Ravi theja K commited on
Commit
254184b
·
verified ·
1 Parent(s): 8ec32d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -14
app.py CHANGED
@@ -1,22 +1,9 @@
1
- #Hello! It seems like you want to import the Streamlit library in Python. Streamlit is a powerful open-source framework used for building web applications with interactive data visualizations and machine learning models. To import Streamlit, you'll need to ensure that you have it installed in your Python environment.
2
- #Once you have Streamlit installed, you can import it into your Python script using the import statement,
3
-
4
  import streamlit as st
5
 
6
- #As Langchain team has been working aggresively on improving the tool, we can see a lot of changes happening every weeek,
7
- #As a part of it, the below import has been depreciated
8
- #from langchain.llms import OpenAI
9
-
10
- #New import from langchain, which replaces the above
11
- from langchain_openai import OpenAI
12
-
13
- #When deployed on huggingface spaces, this values has to be passed using Variables & Secrets setting, as shown in the video :)
14
- #import os
15
- #os.environ["OPENAI_API_KEY"] = "sk-PLfFwPq6y24234234234FJ1Uc234234L8hVowXdt"
16
 
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-instruct",temperature=0)
21
 
22
  #Last week langchain has recommended to use invoke function for the below please :)
 
 
 
 
1
  import streamlit as st
2
 
3
+ from langchain.llm import OpenAI
 
 
 
 
 
 
 
 
 
4
 
5
  #Function to return the response
6
  def load_answer(question):
 
7
  llm = OpenAI(model_name="gpt-3.5-turbo-instruct",temperature=0)
8
 
9
  #Last week langchain has recommended to use invoke function for the below please :)