Merge branch 'master' of github.com:CSUMaVeRick/gpt_academic into CSUMaVeRick-master
Browse files
.github/workflows/master_gptacademic.yml
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
|
2 |
+
# More GitHub Actions for Azure: https://github.com/Azure/actions
|
3 |
+
# More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions
|
4 |
+
|
5 |
+
name: Build and deploy Python app to Azure Web App - GPTacademic
|
6 |
+
|
7 |
+
on:
|
8 |
+
push:
|
9 |
+
branches:
|
10 |
+
- master
|
11 |
+
workflow_dispatch:
|
12 |
+
|
13 |
+
jobs:
|
14 |
+
build:
|
15 |
+
runs-on: ubuntu-latest
|
16 |
+
|
17 |
+
steps:
|
18 |
+
- uses: actions/checkout@v2
|
19 |
+
|
20 |
+
- name: Set up Python version
|
21 |
+
uses: actions/setup-python@v1
|
22 |
+
with:
|
23 |
+
python-version: '3.9'
|
24 |
+
|
25 |
+
- name: Create and start virtual environment
|
26 |
+
run: |
|
27 |
+
python -m venv venv
|
28 |
+
source venv/bin/activate
|
29 |
+
|
30 |
+
- name: Install dependencies
|
31 |
+
run: pip install -r requirements.txt
|
32 |
+
|
33 |
+
# Optional: Add step to run tests here (PyTest, Django test suites, etc.)
|
34 |
+
|
35 |
+
- name: Upload artifact for deployment jobs
|
36 |
+
uses: actions/upload-artifact@v2
|
37 |
+
with:
|
38 |
+
name: python-app
|
39 |
+
path: |
|
40 |
+
.
|
41 |
+
!venv/
|
42 |
+
|
43 |
+
deploy:
|
44 |
+
runs-on: ubuntu-latest
|
45 |
+
needs: build
|
46 |
+
environment:
|
47 |
+
name: 'Production'
|
48 |
+
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
|
49 |
+
|
50 |
+
steps:
|
51 |
+
- name: Download artifact from build job
|
52 |
+
uses: actions/download-artifact@v2
|
53 |
+
with:
|
54 |
+
name: python-app
|
55 |
+
path: .
|
56 |
+
|
57 |
+
- name: 'Deploy to Azure Web App'
|
58 |
+
uses: azure/webapps-deploy@v2
|
59 |
+
id: deploy-to-webapp
|
60 |
+
with:
|
61 |
+
app-name: 'GPTacademic'
|
62 |
+
slot-name: 'Production'
|
63 |
+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_8917F3C29B9D4A63975B1945E8C5833E }}
|
core_functional.py
CHANGED
@@ -68,4 +68,10 @@ def get_core_functions():
|
|
68 |
"Prefix": r"请解释以下代码:" + "\n```\n",
|
69 |
"Suffix": "\n```\n",
|
70 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
|
|
68 |
"Prefix": r"请解释以下代码:" + "\n```\n",
|
69 |
"Suffix": "\n```\n",
|
70 |
},
|
71 |
+
"参考文献转Bib": {
|
72 |
+
"Prefix": r"Here are some bibliography items, please transform them into bibtex style." +
|
73 |
+
r"Note that, reference styles maybe more than one kind, you should transform each item correctly." +
|
74 |
+
r"Items need to be transformed:",
|
75 |
+
"Suffix": r"",
|
76 |
+
}
|
77 |
}
|