feat: ✨ testing in ci, final test of
This commit is contained in:
parent
8456b24318
commit
cbd7656bb4
2 changed files with 29 additions and 34 deletions
57
.github/workflows/main.yaml
vendored
57
.github/workflows/main.yaml
vendored
|
|
@ -45,7 +45,7 @@ jobs:
|
|||
name: ${{ runner.os }} Build
|
||||
path: dist/*
|
||||
|
||||
test-and-package:
|
||||
test-and-publish-extension:
|
||||
needs: pyinstaller
|
||||
strategy:
|
||||
matrix:
|
||||
|
|
@ -135,7 +135,27 @@ jobs:
|
|||
npm run test
|
||||
if: matrix.os != 'ubuntu-20.04'
|
||||
|
||||
# Upload .vsix artifact
|
||||
# Publish the extension and commit/push the version change (ONLY on ubuntu-20.04)
|
||||
|
||||
- name: Publish
|
||||
run: |
|
||||
cd extension
|
||||
npx vsce publish patch -p ${{ secrets.VSCE_TOKEN }}
|
||||
if: matrix.os == 'ubuntu-20.04'
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git commit -am "ci: 💚 Update package.json version [skip ci]"
|
||||
if: matrix.os == 'ubuntu-20.04'
|
||||
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ github.ref }}
|
||||
if: matrix.os == 'ubuntu-20.04'
|
||||
|
||||
- name: Upload .vsix as an artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
|
|
@ -144,42 +164,13 @@ jobs:
|
|||
path: extension/build/*
|
||||
if: matrix.os == 'ubuntu-20.04'
|
||||
|
||||
publish:
|
||||
needs: test-and-package
|
||||
publish-binaries:
|
||||
needs: test-and-publish-extension
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
# Checkout and download .vsix artifact
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Download .vsix artifact
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: vsix-artifact
|
||||
path: extension/build
|
||||
|
||||
# Publish the extension and commit/push the version change
|
||||
|
||||
- name: Publish
|
||||
run: |
|
||||
cd extension
|
||||
npx vsce publish patch -p ${{ secrets.VSCE_TOKEN }}
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git commit -am "ci: 💚 Update package.json version [skip ci]"
|
||||
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ github.ref }}
|
||||
|
||||
# Download binaries and upload to S3
|
||||
|
||||
- name: Download Linux build
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ class TogetherLLM(LLM):
|
|||
prompt += f"<human>: Hi!\n<bot>: {system_message}\n"
|
||||
for message in chat_messages:
|
||||
prompt += f'<{"human" if message["role"] == "user" else "bot"}>: {message["content"]}\n'
|
||||
|
||||
prompt += "<bot>:"
|
||||
return prompt
|
||||
|
||||
async def stream_complete(self, prompt, with_history: List[ChatMessage] = None, **kwargs) -> Generator[Union[Any, List, Dict], None, None]:
|
||||
|
|
@ -113,6 +115,8 @@ class TogetherLLM(LLM):
|
|||
"Authorization": f"Bearer {self.api_key}"
|
||||
}) as resp:
|
||||
try:
|
||||
return await resp.text()
|
||||
text = await resp.text()
|
||||
j = json.loads(text)
|
||||
return j["output"]["choices"][0]["text"]
|
||||
except:
|
||||
raise Exception(await resp.text())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue