Skip to content

Commit

Permalink
fixing remote repo to return commit and update oxen to 0.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gschoeni committed Aug 30, 2023
1 parent 0f565c2 commit 2d6337a
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -53,7 +53,7 @@ The latest documentation can be found at [https://docs.oxen.ai](https://docs.oxe

No really.

We hooked up the GitHub webhook for stars to an [OxenHub repository](https://www.oxen.ai/ox/FlyingOxen). Using a combination of Oxen's [python library](https://docs.oxen.ai/getting-started/python), [remote workspaces](https://docs.oxen.ai/concepts/remote-workspace), and [Stable Diffusion XL](https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/stable_diffusion_xl) we generate a unique Ox for each user, and attempt to give them wings.
We hooked up the GitHub webhook for stars to an [OxenHub Repository](https://www.oxen.ai/ox/FlyingOxen). Using a combination of Oxen's [python library](https://docs.oxen.ai/getting-started/python), [remote workspaces](https://docs.oxen.ai/concepts/remote-workspace), and [Stable Diffusion XL](https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/stable_diffusion_xl) we generate a unique Ox for each user, and attempt to give them wings.

Go find your own in our [ox/FlyingOxen](https://www.oxen.ai/ox/FlyingOxen) repository.

Expand Down
3 changes: 3 additions & 0 deletions oxen/annotations/annotations/labels.txt
@@ -0,0 +1,3 @@
blond
red
brunette
5 changes: 5 additions & 0 deletions oxen/annotations/annotations/test.csv
@@ -0,0 +1,5 @@
file,hair_color
images/6.jpg,blond
images/7.jpg,black
images/8.jpg,black
images/9.jpg,brunette
6 changes: 6 additions & 0 deletions oxen/annotations/annotations/train.csv
@@ -0,0 +1,6 @@
file,hair_color
images/1.jpg,blond
images/2.jpg,red
images/3.jpg,brunette
images/4.jpg,brunette
images/5.jpg,blond
4 changes: 2 additions & 2 deletions oxen/python/oxen/remote_repo.py
Expand Up @@ -192,7 +192,7 @@ def commit(self, message: str):
message: `str`
The commit message.
"""
self._repo.commit(message)
return self._repo.commit(message)

def log(self):
"""
Expand Down Expand Up @@ -241,7 +241,7 @@ def create_branch(self, branch: str):
The name to assign to the created branch
"""
return self._repo.create_branch(branch)

def create_checkout_branch(self, branch: str):
"""
Create a new branch from the currently checked out branch,
Expand Down
12 changes: 6 additions & 6 deletions oxen/src/py_remote_repo.rs
Expand Up @@ -136,19 +136,19 @@ impl PyRemoteRepo {
fn remove(&self, path: PathBuf) -> Result<(), PyOxenError> {
let user_id = UserConfig::identifier()?;
pyo3_asyncio::tokio::get_runtime().block_on(async {
api::remote::staging::rm_staged_file(&self.repo, &self.revision, &user_id, path).await
api::remote::staging::rm_file(&self.repo, &self.revision, &user_id, path).await
})?;
Ok(())
}

fn commit(&self, message: String) -> Result<(), PyOxenError> {
fn commit(&self, message: String) -> Result<PyCommit, PyOxenError> {
let user_id = UserConfig::identifier()?;
let user = UserConfig::get()?.to_user();
let commit = NewCommitBody { message, author: user.name, email: user.email };
pyo3_asyncio::tokio::get_runtime().block_on(async {
api::remote::staging::commit_staged(&self.repo, &self.revision, &user_id, &commit).await
})?;
Ok(())
let commit = api::remote::staging::commit(&self.repo, &self.revision, &user_id, &commit).await?;
Ok(PyCommit { commit })
})
}

fn log(&self) -> Result<Vec<PyCommit>, PyOxenError> {
Expand All @@ -161,7 +161,7 @@ impl PyRemoteRepo {
fn add_df_row(&self, path: PathBuf, data: String) -> Result<(), PyOxenError> {
let user_id = UserConfig::identifier()?;
pyo3_asyncio::tokio::get_runtime().block_on(async {
api::remote::staging::stage_modification(
api::remote::staging::modify_df(
&self.repo,
&self.revision,
&user_id,
Expand Down

0 comments on commit 2d6337a

Please sign in to comment.