From 30de8f1358e9b8117f9afacfc6739d64ed6f8ae6 Mon Sep 17 00:00:00 2001 From: CSUMaVeRick <603312917@qq.com> Date: Thu, 4 May 2023 00:52:12 +0800 Subject: [PATCH 1/5] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/master_gptacademic.yml | 63 ++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/master_gptacademic.yml diff --git a/.github/workflows/master_gptacademic.yml b/.github/workflows/master_gptacademic.yml new file mode 100644 index 0000000..e4189c8 --- /dev/null +++ b/.github/workflows/master_gptacademic.yml @@ -0,0 +1,63 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions +# More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions + +name: Build and deploy Python app to Azure Web App - GPTacademic + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python version + uses: actions/setup-python@v1 + with: + python-version: '3.9' + + - name: Create and start virtual environment + run: | + python -m venv venv + source venv/bin/activate + + - name: Install dependencies + run: pip install -r requirements.txt + + # Optional: Add step to run tests here (PyTest, Django test suites, etc.) + + - name: Upload artifact for deployment jobs + uses: actions/upload-artifact@v2 + with: + name: python-app + path: | + . + !venv/ + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v2 + with: + name: python-app + path: . + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v2 + id: deploy-to-webapp + with: + app-name: 'GPTacademic' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_8917F3C29B9D4A63975B1945E8C5833E }} From 57297605e2d1201570e8cb34007a518f2bd6d613 Mon Sep 17 00:00:00 2001 From: CSUMaVeRick <603312917@qq.com> Date: Thu, 11 May 2023 13:42:51 +0800 Subject: [PATCH 2/5] Update core_functional.py --- core_functional.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core_functional.py b/core_functional.py index 536ccb6..a71140f 100644 --- a/core_functional.py +++ b/core_functional.py @@ -68,4 +68,10 @@ def get_core_functions(): "Prefix": r"请解释以下代码:" + "\n```\n", "Suffix": "\n```\n", }, + "参考文献转Bib": { + "Prefix": r"Here are some bibliography items, please transform them into bibtex style." + + r"Note that, reference styles maybe more than one kind, you should transform each item correctly." + + r"Items need to be transformed:", + "Suffix": r"", + } } From e2d75f1b62f7279d849596afaaa6a1f25cf2af4b Mon Sep 17 00:00:00 2001 From: binary-husky <505030475@qq.com> Date: Fri, 19 May 2023 11:09:30 +0800 Subject: [PATCH 3/5] remove yml --- .github/workflows/master_gptacademic.yml | 63 ------------------------ 1 file changed, 63 deletions(-) delete mode 100644 .github/workflows/master_gptacademic.yml diff --git a/.github/workflows/master_gptacademic.yml b/.github/workflows/master_gptacademic.yml deleted file mode 100644 index e4189c8..0000000 --- a/.github/workflows/master_gptacademic.yml +++ /dev/null @@ -1,63 +0,0 @@ -# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy -# More GitHub Actions for Azure: https://github.com/Azure/actions -# More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions - -name: Build and deploy Python app to Azure Web App - GPTacademic - -on: - push: - branches: - - master - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python version - uses: actions/setup-python@v1 - with: - python-version: '3.9' - - - name: Create and start virtual environment - run: | - python -m venv venv - source venv/bin/activate - - - name: Install dependencies - run: pip install -r requirements.txt - - # Optional: Add step to run tests here (PyTest, Django test suites, etc.) - - - name: Upload artifact for deployment jobs - uses: actions/upload-artifact@v2 - with: - name: python-app - path: | - . - !venv/ - - deploy: - runs-on: ubuntu-latest - needs: build - environment: - name: 'Production' - url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - - steps: - - name: Download artifact from build job - uses: actions/download-artifact@v2 - with: - name: python-app - path: . - - - name: 'Deploy to Azure Web App' - uses: azure/webapps-deploy@v2 - id: deploy-to-webapp - with: - app-name: 'GPTacademic' - slot-name: 'Production' - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_8917F3C29B9D4A63975B1945E8C5833E }} From 5159a1e7a1f5a54afa344ce17027a6457379bbf4 Mon Sep 17 00:00:00 2001 From: binary-husky <505030475@qq.com> Date: Fri, 19 May 2023 11:14:44 +0800 Subject: [PATCH 4/5] =?UTF-8?q?core=20function=20=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core_functional.py | 1 + main.py | 2 ++ request_llm/moss | 1 + 3 files changed, 4 insertions(+) create mode 160000 request_llm/moss diff --git a/core_functional.py b/core_functional.py index a71140f..e126b57 100644 --- a/core_functional.py +++ b/core_functional.py @@ -73,5 +73,6 @@ def get_core_functions(): r"Note that, reference styles maybe more than one kind, you should transform each item correctly." + r"Items need to be transformed:", "Suffix": r"", + "Visible": False, } } diff --git a/main.py b/main.py index 4de8015..d9888f8 100644 --- a/main.py +++ b/main.py @@ -74,6 +74,7 @@ def main(): with gr.Accordion("基础功能区", open=True) as area_basic_fn: with gr.Row(): for k in functional: + if ("Visible" in functional[k]) and (not functional[k]["Visible"]): continue variant = functional[k]["Color"] if "Color" in functional[k] else "secondary" functional[k]["Button"] = gr.Button(k, variant=variant) with gr.Accordion("函数插件区", open=True) as area_crazy_fn: @@ -144,6 +145,7 @@ def main(): clearBtn2.click(lambda: ("",""), None, [txt, txt2]) # 基础功能区的回调函数注册 for k in functional: + if ("Visible" in functional[k]) and (not functional[k]["Visible"]): continue click_handle = functional[k]["Button"].click(fn=ArgsGeneralWrapper(predict), inputs=[*input_combo, gr.State(True), gr.State(k)], outputs=output_combo) cancel_handles.append(click_handle) # 文件上传区,接收文件后与chatbot的互动 diff --git a/request_llm/moss b/request_llm/moss new file mode 160000 index 0000000..4d905bc --- /dev/null +++ b/request_llm/moss @@ -0,0 +1 @@ +Subproject commit 4d905bcead53739d4395b145cae2be308b1df795 From 254fac0045d44a820daa565873f42cedf40b5326 Mon Sep 17 00:00:00 2001 From: binary-husky <505030475@qq.com> Date: Fri, 19 May 2023 11:16:53 +0800 Subject: [PATCH 5/5] move moss folder to gitignore --- .gitignore | 3 ++- request_llm/moss | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 160000 request_llm/moss diff --git a/.gitignore b/.gitignore index 0dd68f8..06ed13d 100644 --- a/.gitignore +++ b/.gitignore @@ -146,4 +146,5 @@ debug* private* crazy_functions/test_project/pdf_and_word crazy_functions/test_samples -request_llm/jittorllms \ No newline at end of file +request_llm/jittorllms +request_llm/moss \ No newline at end of file diff --git a/request_llm/moss b/request_llm/moss deleted file mode 160000 index 4d905bc..0000000 --- a/request_llm/moss +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4d905bcead53739d4395b145cae2be308b1df795