Jobanpreet commited on
Commit
89a1b78
·
verified ·
1 Parent(s): 89978b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -45,7 +45,8 @@ temperature=temperature/10
45
  if option=="GPT-4":
46
  api_key=st.sidebar.text_input("API Key:",placeholder="Enter OpenAI API Key...")
47
  if api_key:
48
- model=ChatOpenAI(model="gpt-4-turbo-preview" , temperature=temperature , api_key=api_key)
 
49
  elif option=="Cohere":
50
  api_key= st.sidebar.text_input("API Key:",placeholder="Enter Cohere API Key...")
51
  if api_key:
 
45
  if option=="GPT-4":
46
  api_key=st.sidebar.text_input("API Key:",placeholder="Enter OpenAI API Key...")
47
  if api_key:
48
+ stream_handler = StreamHandler(st.empty())
49
+ model=ChatOpenAI(model="gpt-4-turbo-preview" , temperature=temperature , api_key=api_key , streaming=True, callbacks=[stream_handler])
50
  elif option=="Cohere":
51
  api_key= st.sidebar.text_input("API Key:",placeholder="Enter Cohere API Key...")
52
  if api_key: