Skip to content

Commit

Permalink
now we can set the default model in config.json
Browse files Browse the repository at this point in the history
this means that we can take hot module replacement on the server when we want to change the defualt model under some circumstances.
  • Loading branch information
Muyu-Chen authored Nov 12, 2024
1 parent d68aad7 commit 5d1d0f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"backend": {
"api-key": "sk-xxxx",
"port": 5000
"port": 5000,
"model": "qwen-plus-0806"
},
"frontend": {
"serverAddress": "http://127.0.0.1",
Expand Down
3 changes: 2 additions & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
config = json.load(file)
api_key_get = config.get('backend', {}).get('api-key', 'api-key-error')
port_default = config.get('backend', {}).get('port', '5000') # Default port
model_default = config.get('backend', {}).get('model', 'qwen-plus-0806') # Default model

app = Flask(__name__)
CORS(app, origins="*") # Allow all origins

model_default = "qwen-plus-0806" # default model



with app.app_context():
Expand Down

0 comments on commit 5d1d0f6

Please sign in to comment.