Skip to content

Commit

Permalink
Merge pull request #41 from gizatechxyz/fix/windows-url-join
Browse files Browse the repository at this point in the history
FIx URL join in windows
  • Loading branch information
Gonmeso authored Feb 7, 2024
2 parents 99037a2 + 70d446b commit ad617af
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 79 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,4 @@ smart_contracts/
.DS_Store

.ruff_cache/
cairo_model/
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Giza CLI 0.9.0
description: Giza CLI 0.9.1
---

# Giza CLI
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/full_transpilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pip install -r requirements.txt
Or:

```bash
pip install giza-cli==0.9.0 onnx==1.14.1 torch==2.1.0 torchvision==0.16.0
pip install giza-cli==0.9.1 onnx==1.14.1 torch==2.1.0 torchvision==0.16.0
```

We will use the libraries for the following purposes:
Expand Down
2 changes: 1 addition & 1 deletion examples/mnist/mnist_pytorch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"Or:\n",
"\n",
"```bash\n",
"pip install giza-cli==0.9.0 onnx==1.14.1 torch==2.1.0 torchvision==0.16.0\n",
"pip install giza-cli==0.9.1 onnx==1.14.1 torch==2.1.0 torchvision==0.16.0\n",
"```\n",
"\n",
"We will use the libraries for the following purposes:\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/mnist/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
giza-cli==0.9.0
giza-cli==0.9.1
onnx==1.14.1
tf2onnx==1.15.1
torch==2.1.0
Expand Down
2 changes: 1 addition & 1 deletion giza/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os

__version__ = "0.9.0"
__version__ = "0.9.1"
# Until DNS is fixed
API_HOST = os.environ.get("GIZA_API_HOST", "https://api.gizatech.xyz")
164 changes: 91 additions & 73 deletions giza/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,13 +464,15 @@ def create(
headers.update(self._get_auth_header())

response = self.session.post(
os.path.join(
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.DEPLOYMENTS_ENDPOINT,
"/".join(
[
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.DEPLOYMENTS_ENDPOINT,
]
),
headers=headers,
params=deployment_create.dict(),
Expand All @@ -494,13 +496,15 @@ def list(self, model_id: int, version_id: int) -> DeploymentsList:
headers.update(self._get_auth_header())

response = self.session.get(
os.path.join(
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.DEPLOYMENTS_ENDPOINT,
"/".join(
[
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.DEPLOYMENTS_ENDPOINT,
]
),
headers=headers,
)
Expand All @@ -526,15 +530,17 @@ def list_proofs(
headers.update(self._get_auth_header())

response = self.session.get(
os.path.join(
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.DEPLOYMENTS_ENDPOINT,
str(deployment_id),
"proofs",
"/".join(
[
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.DEPLOYMENTS_ENDPOINT,
str(deployment_id),
"proofs",
]
),
headers=headers,
)
Expand All @@ -559,16 +565,18 @@ def get_proof(
headers.update(self._get_auth_header())

response = self.session.get(
os.path.join(
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.DEPLOYMENTS_ENDPOINT,
str(deployment_id),
"proofs",
str(proof_id),
"/".join(
[
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.DEPLOYMENTS_ENDPOINT,
str(deployment_id),
"proofs",
str(proof_id),
]
),
headers=headers,
)
Expand All @@ -595,16 +603,18 @@ def download_proof(
headers.update(self._get_auth_header())

response = self.session.get(
os.path.join(
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.DEPLOYMENTS_ENDPOINT,
str(deployment_id),
"proofs",
f"{proof_id}:download",
"/".join(
[
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.DEPLOYMENTS_ENDPOINT,
str(deployment_id),
"proofs",
f"{proof_id}:download",
]
),
headers=headers,
)
Expand Down Expand Up @@ -636,14 +646,16 @@ def get(self, model_id: int, version_id: int, deployment_id: int) -> Deployment:
headers.update(self._get_auth_header())

response = self.session.get(
os.path.join(
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.DEPLOYMENTS_ENDPOINT,
str(deployment_id),
"/".join(
[
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.DEPLOYMENTS_ENDPOINT,
str(deployment_id),
]
),
headers=headers,
)
Expand Down Expand Up @@ -928,14 +940,16 @@ def get(self, model_id: int, version_id: int, job_id: int) -> Job:
headers.update(self._get_auth_header())

response = self.session.get(
os.path.join(
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.JOBS_ENDPOINT,
str(job_id),
"/".join(
[
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.JOBS_ENDPOINT,
str(job_id),
]
),
headers=headers,
)
Expand Down Expand Up @@ -965,13 +979,15 @@ def create(
headers = copy.deepcopy(self.default_headers)
headers.update(self._get_auth_header())
response = self.session.post(
os.path.join(
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.JOBS_ENDPOINT,
"/".join(
[
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.JOBS_ENDPOINT,
]
),
headers=headers,
params=job_create.dict(),
Expand All @@ -995,13 +1011,15 @@ def list(self, model_id: int, version_id: int) -> List[Job]:
headers.update(self._get_auth_header())

response = self.session.get(
os.path.join(
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.JOBS_ENDPOINT,
"/".join(
[
self.url,
self.MODELS_ENDPOINT,
str(model_id),
self.VERSIONS_ENDPOINT,
str(version_id),
self.JOBS_ENDPOINT,
]
),
headers=headers,
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "giza-cli"
version = "0.9.0"
version = "0.9.1"
description = "CLI for interacting with Giza"
authors = ["Gonzalo Mellizo-Soto <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit ad617af

Please sign in to comment.