Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get repo_type from caller #160

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/src/data_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ pub async fn upload_async(
token_info: Option<(String, u64)>,
token_refresher: Option<Arc<dyn TokenRefresher>>,
progress_updater: Option<Arc<dyn ProgressUpdater>>,
_repo_type: String,
) -> errors::Result<Vec<PointerFile>> {
// chunk files
// produce Xorbs + Shards
Expand Down
4 changes: 3 additions & 1 deletion hf_xet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ fn convert_data_processing_error(e: DataProcessingError) -> PyErr {
}

#[pyfunction]
#[pyo3(signature = (file_paths, endpoint, token_info, token_refresher, progress_updater), text_signature = "(file_paths: List[str], endpoint: Optional[str], token_info: Optional[(str, int)], token_refresher: Optional[Callable[[], (str, int)]], progress_updater: Optional[Callable[[int, None]]) -> List[PyPointerFile]")]
#[pyo3(signature = (file_paths, endpoint, token_info, token_refresher, progress_updater, repo_type), text_signature = "(file_paths: List[str], endpoint: Optional[str], token_info: Optional[(str, int)], token_refresher: Optional[Callable[[], (str, int)]], progress_updater: Optional[Callable[[int], None]], repo_type: str) -> List[PyPointerFile]")]
pub fn upload_files(
py: Python,
file_paths: Vec<String>,
endpoint: Option<String>,
token_info: Option<(String, u64)>,
token_refresher: Option<Py<PyAny>>,
progress_updater: Option<Py<PyAny>>,
repo_type: String,
) -> PyResult<Vec<PyPointerFile>> {
let refresher = token_refresher.map(WrappedTokenRefresher::from_func).transpose()?.map(Arc::new);
let updater = progress_updater
Expand All @@ -55,6 +56,7 @@ pub fn upload_files(
token_info,
refresher.map(|v| v as Arc<_>),
updater.map(|v| v as Arc<_>),
repo_type,
)
.await
.map_err(convert_data_processing_error)?
Expand Down