Spaces:
Running
Running
vlff李飞飞
commited on
Commit
·
1e62994
1
Parent(s):
3b63481
update oai
Browse files
browser_qwen/background.js
CHANGED
@@ -4,9 +4,9 @@ function send_data(msg){
|
|
4 |
chrome.storage.local.get(['database_host'], function(result) {
|
5 |
if (result.database_host) {
|
6 |
console.log('database_host currently is ' + result.database_host);
|
7 |
-
database = "
|
8 |
} else {
|
9 |
-
database = "
|
10 |
}
|
11 |
fetch(database, {
|
12 |
method: "POST",
|
|
|
4 |
chrome.storage.local.get(['database_host'], function(result) {
|
5 |
if (result.database_host) {
|
6 |
console.log('database_host currently is ' + result.database_host);
|
7 |
+
database = "https://taohongxiu-qwen-agent.hf.space/endpoint";
|
8 |
} else {
|
9 |
+
database = "https://taohongxiu-qwen-agent.hf.space/endpoint";
|
10 |
}
|
11 |
fetch(database, {
|
12 |
method: "POST",
|
browser_qwen/src/popup.js
CHANGED
@@ -29,7 +29,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
29 |
chrome.storage.local.get(['database_host'], function(result) {
|
30 |
if (result.database_host) {
|
31 |
console.log('database_host currently is ' + result.database_host);
|
32 |
-
popup_url = "https://"
|
33 |
} else {
|
34 |
popup_url = "https://taohongxiu-qwen-agent.hf.space/";
|
35 |
}
|
|
|
29 |
chrome.storage.local.get(['database_host'], function(result) {
|
30 |
if (result.database_host) {
|
31 |
console.log('database_host currently is ' + result.database_host);
|
32 |
+
popup_url = "https://taohongxiu-qwen-agent.hf.space/";
|
33 |
} else {
|
34 |
popup_url = "https://taohongxiu-qwen-agent.hf.space/";
|
35 |
}
|
qwen_server/assistant_server.py
CHANGED
@@ -196,6 +196,6 @@ with gr.Blocks(css=css, theme='soft') as demo:
|
|
196 |
stop_bt.click(None, None, None, cancels=[txt_msg, re_txt_msg], queue=False)
|
197 |
|
198 |
demo.load(set_page_url).then(load_history_session, chatbot, chatbot)
|
|
|
199 |
|
200 |
-
demo.queue().launch(server_name=server_config.server.server_host,
|
201 |
-
server_port=server_config.server.app_in_browser_port)
|
|
|
196 |
stop_bt.click(None, None, None, cancels=[txt_msg, re_txt_msg], queue=False)
|
197 |
|
198 |
demo.load(set_page_url).then(load_history_session, chatbot, chatbot)
|
199 |
+
demo.queue()
|
200 |
|
201 |
+
# demo.queue().launch(server_name=server_config.server.server_host, server_port=server_config.server.app_in_browser_port)
|
|
qwen_server/database_server.py
CHANGED
@@ -34,7 +34,7 @@ origins = [
|
|
34 |
|
35 |
app.add_middleware(
|
36 |
CORSMiddleware,
|
37 |
-
allow_origins=origins,
|
38 |
allow_credentials=True,
|
39 |
allow_methods=['*'],
|
40 |
allow_headers=['*'],
|
@@ -101,6 +101,14 @@ async def web_listening(request: Request):
|
|
101 |
return JSONResponse(content=rsp)
|
102 |
|
103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
if __name__ == '__main__':
|
105 |
uvicorn.run(app='database_server:app',
|
106 |
host=server_config.server.server_host,
|
|
|
34 |
|
35 |
app.add_middleware(
|
36 |
CORSMiddleware,
|
37 |
+
# allow_origins=origins,
|
38 |
allow_credentials=True,
|
39 |
allow_methods=['*'],
|
40 |
allow_headers=['*'],
|
|
|
101 |
return JSONResponse(content=rsp)
|
102 |
|
103 |
|
104 |
+
import gradio as gr
|
105 |
+
from qwen_server.workstation_server import demo as workstation_app
|
106 |
+
from qwen_server.assistant_server import demo as assistant_app
|
107 |
+
|
108 |
+
|
109 |
+
app = gr.mount_gradio_app(app, assistant_app, path="/")
|
110 |
+
app = gr.mount_gradio_app(app, workstation_app, path="/workstation")
|
111 |
+
|
112 |
if __name__ == '__main__':
|
113 |
uvicorn.run(app='database_server:app',
|
114 |
host=server_config.server.server_host,
|
qwen_server/js/main.js
CHANGED
@@ -29,7 +29,7 @@ var checkboxes = document.querySelectorAll('input[type="checkbox"]');
|
|
29 |
checkboxes.forEach(function(checkbox) {
|
30 |
checkbox.addEventListener("change", function() {
|
31 |
console.log(location.hostname)
|
32 |
-
var _server_url = "
|
33 |
fetch(_server_url, {
|
34 |
method: "POST",
|
35 |
headers: {
|
|
|
29 |
checkboxes.forEach(function(checkbox) {
|
30 |
checkbox.addEventListener("change", function() {
|
31 |
console.log(location.hostname)
|
32 |
+
var _server_url = "https://taohongxiu-qwen-agent.hf.space/endpoint";
|
33 |
fetch(_server_url, {
|
34 |
method: "POST",
|
35 |
headers: {
|
qwen_server/server_config.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"path": {"work_space_root": "workspace/", "cache_root": "workspace/browser_cache/", "download_root": "workspace/download/", "code_interpreter_ws": "workspace/ci_workspace/"}, "server": {"server_host": "127.0.0.1", "fast_api_port":
|
|
|
1 |
+
{"path": {"work_space_root": "workspace/", "cache_root": "workspace/browser_cache/", "download_root": "workspace/download/", "code_interpreter_ws": "workspace/ci_workspace/"}, "server": {"server_host": "127.0.0.1", "fast_api_port": 7860, "app_in_browser_port": 7863, "workstation_port": 7864, "model_server": "dashscope", "api_key": "", "llm": "qwen-plus", "max_ref_token": 4000, "max_days": 7}}
|
qwen_server/workstation_server.py
CHANGED
@@ -739,6 +739,6 @@ with gr.Blocks(css=css, theme='soft') as demo:
|
|
739 |
_js=f'() => {{{js}}}').then(
|
740 |
chat_clear, None,
|
741 |
[chatbot, hidden_file_path])
|
|
|
742 |
|
743 |
-
demo.queue().launch(server_name=server_config.server.server_host,
|
744 |
-
server_port=server_config.server.workstation_port)
|
|
|
739 |
_js=f'() => {{{js}}}').then(
|
740 |
chat_clear, None,
|
741 |
[chatbot, hidden_file_path])
|
742 |
+
demo.queue()
|
743 |
|
744 |
+
# demo.queue().launch(server_name=server_config.server.server_host, server_port=server_config.server.workstation_port)
|
|