Spaces:
Sleeping
Sleeping
JohnSmith9982
commited on
Commit
•
cecb277
1
Parent(s):
c79ae64
Upload 37 files
Browse files
ChuanhuChatbot.py
CHANGED
@@ -33,6 +33,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
33 |
with gr.Column():
|
34 |
gr.HTML(title)
|
35 |
user_info = gr.Markdown(value="", elem_id="user_info")
|
|
|
36 |
status_display = gr.Markdown(get_geoip(), elem_id="status_display")
|
37 |
|
38 |
# https://github.com/gradio-app/gradio/pull/3296
|
@@ -98,7 +99,6 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
98 |
two_column = gr.Checkbox(label="双栏pdf", value=advance_docs["pdf"].get("two_column", False))
|
99 |
# TODO: 公式ocr
|
100 |
# formula_ocr = gr.Checkbox(label="识别公式", value=advance_docs["pdf"].get("formula_ocr", False))
|
101 |
-
updateDocConfigBtn = gr.Button("更新解析文件参数")
|
102 |
|
103 |
with gr.Tab(label="Prompt"):
|
104 |
systemPromptTxt = gr.Textbox(
|
@@ -314,7 +314,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
314 |
)
|
315 |
reduceTokenBtn.click(**get_usage_args)
|
316 |
|
317 |
-
|
318 |
|
319 |
# ChatGPT
|
320 |
keyTxt.change(submit_key, keyTxt, [user_api_key, status_display]).then(**get_usage_args)
|
|
|
33 |
with gr.Column():
|
34 |
gr.HTML(title)
|
35 |
user_info = gr.Markdown(value="", elem_id="user_info")
|
36 |
+
gr.HTML('<center><a href="https://huggingface.co/spaces/JohnSmith9982/ChuanhuChatGPT?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a></center>')
|
37 |
status_display = gr.Markdown(get_geoip(), elem_id="status_display")
|
38 |
|
39 |
# https://github.com/gradio-app/gradio/pull/3296
|
|
|
99 |
two_column = gr.Checkbox(label="双栏pdf", value=advance_docs["pdf"].get("two_column", False))
|
100 |
# TODO: 公式ocr
|
101 |
# formula_ocr = gr.Checkbox(label="识别公式", value=advance_docs["pdf"].get("formula_ocr", False))
|
|
|
102 |
|
103 |
with gr.Tab(label="Prompt"):
|
104 |
systemPromptTxt = gr.Textbox(
|
|
|
314 |
)
|
315 |
reduceTokenBtn.click(**get_usage_args)
|
316 |
|
317 |
+
two_column.change(update_doc_config, [two_column], None)
|
318 |
|
319 |
# ChatGPT
|
320 |
keyTxt.change(submit_key, keyTxt, [user_api_key, status_display]).then(**get_usage_args)
|
modules/__pycache__/config.cpython-39.pyc
CHANGED
Binary files a/modules/__pycache__/config.cpython-39.pyc and b/modules/__pycache__/config.cpython-39.pyc differ
|
|
modules/__pycache__/utils.cpython-39.pyc
CHANGED
Binary files a/modules/__pycache__/utils.cpython-39.pyc and b/modules/__pycache__/utils.cpython-39.pyc differ
|
|
modules/config.py
CHANGED
@@ -127,7 +127,7 @@ def retrieve_proxy(proxy=None):
|
|
127 |
os.environ["HTTP_PROXY"] = http_proxy
|
128 |
os.environ["HTTPS_PROXY"] = https_proxy
|
129 |
yield http_proxy, https_proxy # return new proxy
|
130 |
-
|
131 |
# return old proxy
|
132 |
os.environ["HTTP_PROXY"], os.environ["HTTPS_PROXY"] = old_var
|
133 |
|
@@ -139,5 +139,7 @@ def update_doc_config(two_column_pdf):
|
|
139 |
global advance_docs
|
140 |
if two_column_pdf:
|
141 |
advance_docs["pdf"]["two_column"] = True
|
142 |
-
|
|
|
|
|
143 |
logging.info(f"更新后的文件参数为:{advance_docs}")
|
|
|
127 |
os.environ["HTTP_PROXY"] = http_proxy
|
128 |
os.environ["HTTPS_PROXY"] = https_proxy
|
129 |
yield http_proxy, https_proxy # return new proxy
|
130 |
+
|
131 |
# return old proxy
|
132 |
os.environ["HTTP_PROXY"], os.environ["HTTPS_PROXY"] = old_var
|
133 |
|
|
|
139 |
global advance_docs
|
140 |
if two_column_pdf:
|
141 |
advance_docs["pdf"]["two_column"] = True
|
142 |
+
else:
|
143 |
+
advance_docs["pdf"]["two_column"] = False
|
144 |
+
|
145 |
logging.info(f"更新后的文件参数为:{advance_docs}")
|