Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- HfApi_testing.Rmd +21 -0
HfApi_testing.Rmd
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: "hfhub_testing"
|
| 3 |
+
output: html_document
|
| 4 |
+
date: "2024-04-04"
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
```{r setup, include=FALSE}
|
| 8 |
+
knitr::opts_chunk$set(echo = TRUE)
|
| 9 |
+
```
|
| 10 |
+
|
| 11 |
+
```{r}
|
| 12 |
+
hf <- reticulate::import("huggingface_hub")
|
| 13 |
+
api <- hf$HfApi()
|
| 14 |
+
api$create_repo(repo_id="aoiferyan/api_first_attempt", repo_type="space", space_sdk="gradio")
|
| 15 |
+
|
| 16 |
+
api$upload_folder(repo_id="aoiferyan/api_first_attempt", repo_type="space", folder_path="/Users/aoiferyan/Library/CloudStorage/GoogleDrive-aoife.ryan@sharecreative.com/My Drive/Big Think/bigThink_5Apr2024")
|
| 17 |
+
|
| 18 |
+
api$delete_space_storage(repo_id="aoiferyan/api_first_attempt")
|
| 19 |
+
|
| 20 |
+
api$request_space_hardware(repo_id=repo_id, hardware=SpaceHardware.T4_MEDIUM)
|
| 21 |
+
```
|