-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HIGHLIGHT: added context support for /v1/chat/completions
- Added "enable context?" toggle to Model Settings to turn on/off context (default = True) - Added n_ctx in config.json set context size if context is enabled - now load config into session_state and read from session_state instead of config
- Loading branch information
Showing
6 changed files
with
179 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"api_url": "http://localhost:8000", | ||
"page_title": "Llama-2-7b-Chat" | ||
"page_title": "Llama-2-7b-Chat", | ||
"n_ctx": 2048 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import json | ||
import streamlit as st | ||
|
||
# load config-file | ||
def load(): | ||
# initialize context in session state if not present | ||
if 'context' not in st.session_state: | ||
st.session_state['context'] = [] | ||
|
||
# load config in session state | ||
with open("src/config.json", "r", encoding="utf-8") as file: | ||
config = json.load(file) | ||
st.session_state['api_url'] = config['api_url'] if 'api_url' in config else "http://localhost:8000" | ||
st.session_state['title'] = config['title'] if 'title' in config else "Llama-2-7b-Chat" | ||
st.session_state['n_ctx'] = int(config['n_ctx']) if 'n_ctx' in config else 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters