Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
#the below import has been replaced by the later mentioned import, recently by langchain as a per of their improvement strategy :)
|
2 |
#from langchain.chat_models import ChatOpenAI
|
3 |
-
from langchain_openai import ChatOpenAI
|
4 |
-
|
5 |
from langchain.schema import HumanMessage, SystemMessage
|
6 |
from io import StringIO
|
7 |
import streamlit as st
|
@@ -51,8 +51,9 @@ if data:
|
|
51 |
st.write(fetched_data)
|
52 |
|
53 |
# Initialize a ChatOpenAI instance with the specified model name "gpt-3.5-turbo" and a temperature of 0.9.
|
54 |
-
chat = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0.9)
|
55 |
-
|
|
|
56 |
# Create a SystemMessage instance with the specified content, providing information about the assistant's role.
|
57 |
systemMessage = SystemMessage(content="You are a code review assistant. Provide detailed suggestions to improve the given Python code along by mentioning the existing code line by line with proper indent")
|
58 |
|
|
|
1 |
#the below import has been replaced by the later mentioned import, recently by langchain as a per of their improvement strategy :)
|
2 |
#from langchain.chat_models import ChatOpenAI
|
3 |
+
#from langchain_openai import ChatOpenAI
|
4 |
+
from langchain_community.llms import HuggingFaceEndpoint
|
5 |
from langchain.schema import HumanMessage, SystemMessage
|
6 |
from io import StringIO
|
7 |
import streamlit as st
|
|
|
51 |
st.write(fetched_data)
|
52 |
|
53 |
# Initialize a ChatOpenAI instance with the specified model name "gpt-3.5-turbo" and a temperature of 0.9.
|
54 |
+
#chat = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0.9)
|
55 |
+
chat = HuggingFaceEndpoint(temperature=0.9,repo_id="mistralai/Mixtral-8x7B-Instruct-v0.1") #"mistralai/Mistral-7B-Instruct-v0.2" # 'text-davinci-003' model is depreciated now, so we are using the openai's recommended model
|
56 |
+
|
57 |
# Create a SystemMessage instance with the specified content, providing information about the assistant's role.
|
58 |
systemMessage = SystemMessage(content="You are a code review assistant. Provide detailed suggestions to improve the given Python code along by mentioning the existing code line by line with proper indent")
|
59 |
|