Spaces:
Running
on
L4
Running
on
L4
added oauth to README
Browse files
README.md
CHANGED
@@ -4,6 +4,11 @@ emoji: 👁
|
|
4 |
colorFrom: blue
|
5 |
colorTo: pink
|
6 |
sdk: docker
|
|
|
|
|
|
|
|
|
|
|
7 |
pinned: false
|
8 |
license: mit
|
9 |
---
|
|
|
4 |
colorFrom: blue
|
5 |
colorTo: pink
|
6 |
sdk: docker
|
7 |
+
hf_oauth: true
|
8 |
+
hf_oauth_scopes:
|
9 |
+
- read-repos
|
10 |
+
- write-repos
|
11 |
+
- manage-repos
|
12 |
pinned: false
|
13 |
license: mit
|
14 |
---
|
app.py
CHANGED
@@ -69,12 +69,11 @@ QUANTIZATIONS = ["q0f16",
|
|
69 |
"q4f32_1",
|
70 |
"q4f16_awq"]
|
71 |
|
72 |
-
def button_click(hf_model_id, conv_template, quantization):
|
73 |
-
|
74 |
-
|
75 |
|
76 |
-
|
77 |
-
api = HfApi()
|
78 |
model_dir_name = hf_model_id.split("/")[1]
|
79 |
mlc_model_name = model_dir_name + "-" + quantization + "-" + "MLC"
|
80 |
|
|
|
69 |
"q4f32_1",
|
70 |
"q4f16_awq"]
|
71 |
|
72 |
+
def button_click(hf_model_id, conv_template, quantization, oauth_token: gr.OAuthToken | None):
|
73 |
+
if not oauth_token.token:
|
74 |
+
raise ValueError("Log in to Huggingface to use this")
|
75 |
|
76 |
+
api = HfApi(token=oauth_token.token)
|
|
|
77 |
model_dir_name = hf_model_id.split("/")[1]
|
78 |
mlc_model_name = model_dir_name + "-" + quantization + "-" + "MLC"
|
79 |
|