Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mpog-helper-openai
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anes_AI
mpog-helper-openai
Commits
c341b542
Commit
c341b542
authored
2 years ago
by
Ryan Melvin
Browse files
Options
Downloads
Patches
Plain Diff
use azure api
parent
9f593a34
No related branches found
Branches containing commit
No related tags found
1 merge request
!3
Feature/azure2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app.py
+10
-3
10 additions, 3 deletions
app.py
deploy/Dockerfile
+1
-1
1 addition, 1 deletion
deploy/Dockerfile
with
11 additions
and
4 deletions
app.py
+
10
−
3
View file @
c341b542
...
...
@@ -3,7 +3,7 @@
import
streamlit
as
st
from
langchain.vectorstores
import
FAISS
from
langchain.embeddings
import
OpenAIEmbeddings
from
langchain.chat_models
import
ChatOpenAI
from
langchain.chat_models
import
Azure
ChatOpenAI
from
langchain.prompts
import
(
ChatPromptTemplate
,
SystemMessagePromptTemplate
,
...
...
@@ -72,7 +72,7 @@ st.markdown("""
Brought to you by the Anesthesiology MPOG Steering Committee, Informatics, and Data Science teams
_Not affiliated with MPOG.
Uses external resources.
Not approved for use with PHI
or sensitive data
._
_Not affiliated with MPOG. Not approved for use with PHI._
All submissions are recorded for potential review by the MPOG Steering Committee.
...
...
@@ -89,7 +89,14 @@ You can trick generative AIs into saying whatever you want. If you succeed in tr
As always, use your best judgment. An AI can do the wrong thing at the worst time.
"""
)
chat
=
ChatOpenAI
(
temperature
=
0
,
model_name
=
"
gpt-3.5-turbo
"
)
chat
=
AzureChatOpenAI
(
openai_api_base
=
"
https://nlp-openai-svc.openai.azure.com
"
,
openai_api_version
=
"
2023-03-15-preview
"
,
deployment_name
=
"
ChatGPT35Turbo
"
,
openai_api_key
=
OPENAI_API_KEY
,
openai_api_type
=
"
azure
"
,
temperature
=
0
)
# Load vectorstore
embedding
=
OpenAIEmbeddings
()
vectordb
=
FAISS
.
load_local
(
"
faiss_index
"
,
embedding
)
...
...
This diff is collapsed.
Click to expand it.
deploy/Dockerfile
+
1
−
1
View file @
c341b542
...
...
@@ -19,7 +19,7 @@ RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
# Check if repo has been updated since last build
ADD
"https://gitlab.rc.uab.edu/anes_ai/mpog-helper-openai/commits?per_page=1" latest_commit
RUN
rm
-rf
latest_commit
RUN
git clone https://gitlab.rc.uab.edu/anes_ai/mpog-helper-openai.git .
RUN
git clone
-b
feature/azure2
https://gitlab.rc.uab.edu/anes_ai/mpog-helper-openai.git .
#COPY .streamlit/secrets.toml /deploy/.streamlit/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment