Skip to content

Commit

Permalink
Merge pull request #35 from Integration-Automation/dev
Browse files Browse the repository at this point in the history
Update version and test
  • Loading branch information
JE-Chen committed Oct 25, 2023
2 parents d03696a + 35823b0 commit 89ae7ce
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions stable.toml → dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "re_edge_gpt"
version = "0.0.13"
name = "re_edge_gpt_dev"
version = "0.0.14"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "re_edge_gpt_dev"
version = "0.0.13"
name = "re_edge_gpt"
version = "0.0.14"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
Expand Down
4 changes: 2 additions & 2 deletions re_edge_gpt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from re_edge_gpt.re_edge_gpt import Chatbot
from re_edge_gpt.re_edge_gpt import ConversationStyle
from re_edge_gpt.image_genearation import ImageGen
from re_edge_gpt.image_genearation import ImageGenAsync
from re_edge_gpt.re_edge_gpt import Chatbot
from re_edge_gpt.re_edge_gpt import ConversationStyle

__all__ = [
"Chatbot", "ConversationStyle", "ImageGen", "ImageGenAsync"
Expand Down
8 changes: 4 additions & 4 deletions re_edge_gpt/image_genearation.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def get_images(self, prompt: str) -> Union[list, None]:
url = f"{BING_URL}/images/create?q={url_encoded_prompt}&rt=3&FORM=GUH2CR"
response = self.session.post(url, allow_redirects=False, timeout=200)
if response.status_code != 302:
print("Image Creating Please Retry Later", end="", flush=True)
print("Image create failed pls check cookie or old image still creating", flush=True)
return
# Get redirect URL
redirect_url = response.headers["Location"].replace("&nfy=1", "")
Expand Down Expand Up @@ -310,9 +310,9 @@ async def get_images(self, prompt: str) -> Union[list, None]:
follow_redirects=False,
timeout=200,
)
if response.status_code != 302:
print("Image Creating Please Retry Later", end="", flush=True)
return None
if response.status_code != 302:
print("Image create failed pls check cookie or old image still creating", flush=True)
return None
# Get redirect URL
redirect_url = response.headers["Location"].replace("&nfy=1", "")
request_id = redirect_url.split("id=")[-1]
Expand Down
2 changes: 1 addition & 1 deletion test/unit_test/test_generate_image/test_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_generate_image_sync():

# Generate image list async
async def test_generate_image_async():
image_list = await async_gen.get_images("Big, Golden, Tree")
image_list = await async_gen.get_images("La Tour Eiffel")
print(image_list)


Expand Down

0 comments on commit 89ae7ce

Please sign in to comment.