Skip to content

Commit

Permalink
cuv2 api upgrade (#83)
Browse files Browse the repository at this point in the history
* cuv2 api upgrade

* delete yay

---------

Co-authored-by: Michael Ryave <[email protected]>
  • Loading branch information
mryave and Michael Ryave authored Oct 8, 2024
1 parent 0b92625 commit 453fa13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
16 changes: 6 additions & 10 deletions arcee/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def upload_corpus_folder(corpus: str, s3_folder_url: str, tokenizer_name: str, b
"block_size": block_size,
}

return make_request("post", Route.pretraining + "/corpusUpload", data)
return make_request("post", Route.corpus, data)


def upload_qa_pairs(
Expand Down Expand Up @@ -321,30 +321,26 @@ def merging_status(merging: str) -> Dict[str, str]:
return make_request("get", Route.merging + "/status", data)


def delete_corpus(corpus: str) -> Dict[str, str]:
def delete_corpus(corpus_name: str) -> Dict[str, str]:
"""
Delete a corpus
Args:
corpus (str): The name of the corpus to delete
"""
data = {"corpus_name": corpus_name}
return make_request("delete", Route.corpus + "/delete", data)

data = {"corpus_name": corpus}

return make_request("post", Route.pretraining + "/deleteCorpus", data)


def corpus_status(corpus: str) -> Dict[str, str]:
def corpus_status(corpus_id: str) -> Dict[str, str]:
"""
Check the status of a corpus
Args:
corpus (str): The name of the corpus to check the status
"""

data = {"corpus_name": corpus}

return make_request("post", Route.pretraining + "/corpus/status", data)
return make_request("get", Route.corpus + f"/status/{corpus_id}")


def start_alignment(
Expand Down
1 change: 1 addition & 0 deletions arcee/schemas/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ class Route(StrEnum):
deployment = "deployment"
merging = "merging"
retriever = "models"
corpus = "pretraining/corpus"

0 comments on commit 453fa13

Please sign in to comment.