forked from weaigc/bingo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
21 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import openai | ||
openai.api_key = "dummy" | ||
openai.api_base = "https://copilot.github1s.tk" # 这里可以改为你自己部署的服务,bingo 服务版本需要 >= 0.9.0 | ||
|
||
# create a chat completion | ||
completion = openai.ChatCompletion.create(model="Creative", stream=True, messages=[{"role": "user", "content": "Hello"}]) | ||
for chat_completion in completion: | ||
# print the completion | ||
print(chat_completion.choices[0].message.content, end="", flush=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import openai | ||
openai.api_key = "dummy" | ||
openai.api_base = "https://hf4all-bingo-api.hf.space" # 这里可以改为你自己部署的服务,bingo 服务版本需要 >= 0.9.0 | ||
|
||
openai.api_key = "dummy" | ||
openai.api_base = "https://copilot.github1s.tk" # 这里可以改为你自己部署的服务,bingo 服务版本需要 >= 0.9.0 | ||
# create a chat completion | ||
completion = openai.ChatCompletion.create(model="Creative", stream=True, messages=[{"role": "user", "content": "Hello"}]) | ||
for chat_completion in completion: | ||
# print the completion | ||
print(chat_completion.choices[0].message.content, end="", flush=True) | ||
completion = openai.ChatCompletion.create(model="gpt-4", stream=False, messages=[{"role": "user", "content": "Hello"}]) | ||
print(completion.choices[0].message.content) |