MekkCyber commited on
Commit
1c806d1
·
1 Parent(s): f71fb6d

add zero gpu

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -6,6 +6,7 @@ from huggingface_hub import HfApi
6
  from huggingface_hub import list_models
7
  from packaging import version
8
  import os
 
9
 
10
  def hello(profile: gr.OAuthProfile | None, oauth_token: gr.OAuthToken | None) -> str:
11
  # ^ expect a gr.OAuthProfile object as input to get the user's profile
@@ -59,6 +60,7 @@ model = AutoModel.from_pretrained("{model_name}")"""
59
 
60
  return model_card
61
 
 
62
  def quantize_model(model_name, quantization_type, group_size=128, auth_token=None, username=None, device="cuda"):
63
  print(f"Quantizing model: {quantization_type}")
64
  if quantization_type == "int4_weight_only" :
 
6
  from huggingface_hub import list_models
7
  from packaging import version
8
  import os
9
+ import spaces
10
 
11
  def hello(profile: gr.OAuthProfile | None, oauth_token: gr.OAuthToken | None) -> str:
12
  # ^ expect a gr.OAuthProfile object as input to get the user's profile
 
60
 
61
  return model_card
62
 
63
+ @spaces.GPU
64
  def quantize_model(model_name, quantization_type, group_size=128, auth_token=None, username=None, device="cuda"):
65
  print(f"Quantizing model: {quantization_type}")
66
  if quantization_type == "int4_weight_only" :