Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Try spec global
Browse files
app.py
CHANGED
@@ -16,13 +16,14 @@ TOKEN = os.environ.get("HUGGINGFACE_API_LOGIN", None)
|
|
16 |
|
17 |
def check_for_discussion(model_name:str):
|
18 |
"Checks if an automated discussion has been opened on the model by `model-sizer-bot`"
|
|
|
19 |
api = HfApi(token=TOKEN)
|
20 |
discussions = list(api.get_repo_discussions(model_name))
|
21 |
return any(discussion.title == "[AUTOMATED] Model Memory Requirements" and discussion.author == "model-sizer-bot" for discussion in discussions)
|
22 |
|
23 |
def report_results():
|
24 |
"Reports the results of a memory calculation to the model's discussion page, and opens a new tab to it afterwards"
|
25 |
-
global MODEL_NAME, LIBRARY
|
26 |
api = HfApi(token=TOKEN)
|
27 |
results = calculate_memory(MODEL_NAME, LIBRARY, ["fp32", "fp16", "int8", "int4"], raw=True)
|
28 |
post = f"""# Model Memory Requirements\n
|
|
|
16 |
|
17 |
def check_for_discussion(model_name:str):
|
18 |
"Checks if an automated discussion has been opened on the model by `model-sizer-bot`"
|
19 |
+
global TOKEN
|
20 |
api = HfApi(token=TOKEN)
|
21 |
discussions = list(api.get_repo_discussions(model_name))
|
22 |
return any(discussion.title == "[AUTOMATED] Model Memory Requirements" and discussion.author == "model-sizer-bot" for discussion in discussions)
|
23 |
|
24 |
def report_results():
|
25 |
"Reports the results of a memory calculation to the model's discussion page, and opens a new tab to it afterwards"
|
26 |
+
global MODEL_NAME, LIBRARY, TOKEN
|
27 |
api = HfApi(token=TOKEN)
|
28 |
results = calculate_memory(MODEL_NAME, LIBRARY, ["fp32", "fp16", "int8", "int4"], raw=True)
|
29 |
post = f"""# Model Memory Requirements\n
|