Spaces:
Paused
Paused
rodrigomasini
commited on
Commit
•
3b33c19
1
Parent(s):
0831088
Update app_v4.py
Browse files
app_v4.py
CHANGED
@@ -15,9 +15,9 @@ def get_gpu_memory():
|
|
15 |
memory_info = [{"free": "N/A", "total": "N/A"}]
|
16 |
return memory_info
|
17 |
|
18 |
-
# Display GPU memory information
|
19 |
-
|
20 |
-
st.write(f"GPU Memory Info: {
|
21 |
|
22 |
# Define pretrained model directory
|
23 |
pretrained_model_dir = "FPHam/Jackson_The_Formalizer_V2_13b_GPTQ"
|
@@ -43,11 +43,15 @@ try:
|
|
43 |
)
|
44 |
except RuntimeError as e:
|
45 |
if 'CUDA out of memory' in str(e):
|
46 |
-
st.error("CUDA out of memory
|
47 |
st.stop()
|
48 |
else:
|
49 |
raise e
|
50 |
|
|
|
|
|
|
|
|
|
51 |
# User input for the model
|
52 |
user_input = st.text_input("Input a phrase")
|
53 |
|
|
|
15 |
memory_info = [{"free": "N/A", "total": "N/A"}]
|
16 |
return memory_info
|
17 |
|
18 |
+
# Display GPU memory information before loading the model
|
19 |
+
gpu_memory_before = get_gpu_memory()
|
20 |
+
st.write(f"GPU Memory Info before loading the model: {gpu_memory_before}")
|
21 |
|
22 |
# Define pretrained model directory
|
23 |
pretrained_model_dir = "FPHam/Jackson_The_Formalizer_V2_13b_GPTQ"
|
|
|
43 |
)
|
44 |
except RuntimeError as e:
|
45 |
if 'CUDA out of memory' in str(e):
|
46 |
+
st.error("CUDA out of memory while loading the model. Try reducing the model size or input length.")
|
47 |
st.stop()
|
48 |
else:
|
49 |
raise e
|
50 |
|
51 |
+
# Display GPU memory information after loading the model
|
52 |
+
gpu_memory_after = get_gpu_memory()
|
53 |
+
st.write(f"GPU Memory Info after loading the model: {gpu_memory_after}")
|
54 |
+
|
55 |
# User input for the model
|
56 |
user_input = st.text_input("Input a phrase")
|
57 |
|