Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit 2cdfeeb

Browse files
committed
2 parents 122fbc0 + bfd254f commit 2cdfeeb

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ import OpenGPT
8383
You can install this project as module using pip command.
8484

8585
```shell
86-
pip install opengpt4
86+
pip install opengpt4==0.1.1
8787
```
88+
> It's recommend to use 0.1.1 version for now, the latest version is with bugs. If you want to use the latest version just download source code.
8889
8990
After install, for use it's simple, you can work with something model like this:
9091

opengpt/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import yaml
55
import sys
66
import inspect
7+
import os
78

89
init()
910

@@ -19,6 +20,8 @@ def Print(context: Text, warn: Optional[bool] = False) -> None:
1920
class OpenGPT:
2021
@classmethod
2122
def __init__(self: type, provider: Text, type: Optional[Text] = "completion", options: Optional[Union[Dict[Text, Text], None]] = None) -> None:
23+
24+
self.__DIR: Text = os.getcwd()
2225
self.__LoadModels()
2326
self.__TYPE: Text = type
2427
self.__OPTIONS: Union[Dict[Text, Text], None] = options
@@ -55,7 +58,7 @@ def __InitializeModelClass(self: type) -> None:
5558

5659
@classmethod
5760
def __LoadModels(self: type) -> None:
58-
self.__DATA: Dict[Text, Text] = yaml.safe_load(open("opengpt/config.yml").read())
61+
self.__DATA: Dict[Text, Text] = yaml.safe_load(open(self.__DIR + "/config.yml").read())
5962

6063
@classmethod
6164
def __Verifications(self: type) -> None:
@@ -96,4 +99,4 @@ def __getattr__(self: type, name: Text) -> None:
9699
if callable(attr):
97100
return lambda *args, **kwargs: attr(*args, **kwargs)
98101
return attr
99-
raise AttributeError(f"\"OpenGPT\" object has no attribute \"{name}\"")
102+
raise AttributeError(f"\"OpenGPT\" object has no attribute \"{name}\"")

opengpt/models/image/hotpot/model.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import requests
77
import fake_useragent
88
import logging
9+
import os
910

1011
init()
1112

@@ -23,6 +24,7 @@ class Model:
2324
def __init__(self: type, style: Optional[Text] = "Hotpot Art 9") -> None:
2425
self._SETUP_LOGGER()
2526
self.__LoadStyles()
27+
self.__DIR: Text = os.getcwd()
2628
self.__session: requests.Session = requests.Session()
2729
self.__UNIQUE_ID: str = UniqueID(16)
2830
self.STYLE: Text = style
@@ -71,7 +73,7 @@ def UpdateStyle(self: type, style: Text) -> None:
7173

7274
@classmethod
7375
def __LoadStyles(self: type) -> None:
74-
self.__DATA: Dict[Text, Text] = yaml.safe_load(open("opengpt/models/image/hotpot/styles.yml").read())
76+
self.__DATA: Dict[Text, Text] = yaml.safe_load(open(self.__DIR + "/styles.yml").read())
7577

7678
@classmethod
7779
def __Fields(self: type, *args: Tuple[int, str], **kwargs: Dict[str, Any]) -> Text:
@@ -111,4 +113,4 @@ def Generate(self: type, prompt: Text, width: Optional[int] = 256, height: Optio
111113
"style": self.STYLE,
112114
"width": __DATA["width"],
113115
"height": __DATA["height"]
114-
})
116+
})

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
[tool.poetry]
22
name = "opengpt4"
3-
version = "0.1.1"
3+
version = "0.1.6"
44
description = ""
55
authors = []
66
license = "GPL-3.0"
77
readme = "README.md"
8-
packages = [{ include = "opengpt" }]
9-
exclude = ["**/*.txt"]
8+
packages = [{ include = "opengpt"}, { include = "libraries"}]
109

1110
[tool.poetry.dependencies]
1211
python = "^3.7"
1312
requests = "2.29.0"
1413
tls-client = "^0.2"
1514
fake-useragent = "^1.1.3"
1615
pydantic = "^1.10.7"
17-
16+
PyYAML = "6.0"
1817

1918
[build-system]
2019
requires = ["poetry-core"]

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ pydantic==1.10.7
33
fake-useragent==1.1.3
44
requests==2.28.2
55
pycryptodome==3.17
6+
PyYAML==6.0

0 commit comments

Comments
 (0)