---
title: model-memory-usage
canonical_url: "https://www.modelscope.cn/studios/AlphaHinex/model-memory-usage"
md_url: "https://www.modelscope.cn/studios/AlphaHinex/model-memory-usage.md"
repository: AlphaHinex/model-memory-usage
last_updated: 2025-02-27
sdk_type: gradio
sdk_version: 4.44.0
downloads: 0
stars: 2
---

# model-memory-usage

> model-memory-usage - AlphaHinex 在 ModelScope 创建的在线 Demo。Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

AlphaHinex/model-memory-usage 是 ModelScope 魔搭社区上的在线可交互 Demo（创空间），基于 gradio 4.44.0 构建。

- **Repository**: AlphaHinex/model-memory-usage
- **SDK**: gradio
- **SDK version**: 4.44.0
- **Downloads**: 0
- **Stars**: 2
- **Last updated**: 2025-02-27

Source: https://www.modelscope.cn/studios/AlphaHinex/model-memory-usage

---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

---


README of `hotfix` Branch
=========================

Click [here](https://github.com/AlphaHinex/model-memory-usage/compare/main...hotfix) (or as below) to check differences between original [main](https://huggingface.co/spaces/hf-accelerate/model-memory-usage/tree/main) branch and `hotfix` branch.

```diff
diff --git a/requirements.txt b/requirements.txt
index c3896f5..918ea24 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,4 +3,5 @@ transformers
 timm
 huggingface_hub==0.19.4
 tabulate
-einops
\ No newline at end of file
+einops
+gradio==4.43.0
diff --git a/src/app.py b/src/app.py
index 7a5e23e..500023a 100644
--- a/src/app.py
+++ b/src/app.py
@@ -7,6 +7,8 @@ from model_utils import calculate_memory, get_model


 def get_results(model_name: str, library: str, options: list, access_token: str):
+    if access_token == "":
+        access_token = None
     model = get_model(model_name, library, access_token)
     # try:
     #     has_discussion = check_for_discussion(model_name)
```

How to run locally
------------------

1. Use python 3.8 version
2. `pip install -r requirements.txt`
3. `python src/app.py` or `HF_ENDPOINT=https://hf-mirror.com python src/app.py`

![](./run-in-local.png)
