Spaces:
Paused
Paused
Commit
·
fad9e5e
1
Parent(s):
0fcb40c
full prec
Browse files- app.py +0 -2
- requirements.txt +1 -0
app.py
CHANGED
@@ -18,10 +18,8 @@ def load_model():
|
|
18 |
model = AutoModelForCausalLM.from_pretrained(
|
19 |
"omi-health/sum-small",
|
20 |
trust_remote_code=False,
|
21 |
-
torch_dtype=torch.float16, # Half precision
|
22 |
device_map="auto" # Let the library decide best device mapping
|
23 |
)
|
24 |
-
print(f"Model loaded with float16 precision on GPU")
|
25 |
print(f"GPU: {torch.cuda.get_device_name(0)}")
|
26 |
print(f"Memory allocated: {torch.cuda.memory_allocated(0) / 1024**2:.2f} MB")
|
27 |
else:
|
|
|
18 |
model = AutoModelForCausalLM.from_pretrained(
|
19 |
"omi-health/sum-small",
|
20 |
trust_remote_code=False,
|
|
|
21 |
device_map="auto" # Let the library decide best device mapping
|
22 |
)
|
|
|
23 |
print(f"GPU: {torch.cuda.get_device_name(0)}")
|
24 |
print(f"Memory allocated: {torch.cuda.memory_allocated(0) / 1024**2:.2f} MB")
|
25 |
else:
|
requirements.txt
CHANGED
@@ -2,3 +2,4 @@
|
|
2 |
torch
|
3 |
transformers>=4.36.0
|
4 |
gradio>=3.50.0
|
|
|
|
2 |
torch
|
3 |
transformers>=4.36.0
|
4 |
gradio>=3.50.0
|
5 |
+
accelerate
|