Spaces:
Running
on
Zero
Running
on
Zero
chore: add Access Token
Browse files
app.py
CHANGED
@@ -39,12 +39,12 @@ if cuda_path:
|
|
39 |
print(f"CUDA 已安装在:{cuda_path}")
|
40 |
else:
|
41 |
print("未找到已安装的 CUDA 路径")
|
42 |
-
|
43 |
# 从 HF 加载预训练模型
|
44 |
class LRMGeneratorWrapper:
|
45 |
def __init__(self):
|
46 |
-
self.config = AutoConfig.from_pretrained("yanranxiaoxi/image-upscale", trust_remote_code=True)
|
47 |
-
self.model = AutoModel.from_pretrained("yanranxiaoxi/image-upscale", trust_remote_code=True)
|
48 |
self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
49 |
self.model.to(self.device)
|
50 |
self.model.eval()
|
|
|
39 |
print(f"CUDA 已安装在:{cuda_path}")
|
40 |
else:
|
41 |
print("未找到已安装的 CUDA 路径")
|
42 |
+
|
43 |
# 从 HF 加载预训练模型
|
44 |
class LRMGeneratorWrapper:
|
45 |
def __init__(self):
|
46 |
+
self.config = AutoConfig.from_pretrained("yanranxiaoxi/image-upscale", trust_remote_code=True, token=os.environ.get('MODEL_ACCESS_TOKEN'))
|
47 |
+
self.model = AutoModel.from_pretrained("yanranxiaoxi/image-upscale", trust_remote_code=True, token=os.environ.get('MODEL_ACCESS_TOKEN'))
|
48 |
self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
49 |
self.model.to(self.device)
|
50 |
self.model.eval()
|