Update app.py
Browse files
app.py
CHANGED
|
@@ -28,18 +28,8 @@ def check_model_access(model_id: str, oauth_token: gr.OAuthToken | None):
|
|
| 28 |
try:
|
| 29 |
# 3. The core test: try to load the model's config using the user's token.
|
| 30 |
# This will fail if the user doesn't have access to the gated repo's files.
|
| 31 |
-
|
| 32 |
|
| 33 |
-
model = NeuronFluxPipeline.from_pretrained(
|
| 34 |
-
model_id,
|
| 35 |
-
export=True,
|
| 36 |
-
tensor_parallel_size=4,
|
| 37 |
-
token=oauth_token.token,
|
| 38 |
-
batch_size=1,
|
| 39 |
-
sequence_length=128,
|
| 40 |
-
)
|
| 41 |
-
|
| 42 |
-
|
| 43 |
# 4. If the call succeeds, format a success message
|
| 44 |
return f"""
|
| 45 |
### <span style='color: green;'>Access Granted ✅</span>
|
|
|
|
| 28 |
try:
|
| 29 |
# 3. The core test: try to load the model's config using the user's token.
|
| 30 |
# This will fail if the user doesn't have access to the gated repo's files.
|
| 31 |
+
pipe = FluxPipeline.from_pretrained(pretrained_model_name_or_path=model_id, torch_dtype=torch.bfloat16, token=oauth_token.token)
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
# 4. If the call succeeds, format a success message
|
| 34 |
return f"""
|
| 35 |
### <span style='color: green;'>Access Granted ✅</span>
|