Spaces:
Running
Running
Commit
·
dc1d7fe
1
Parent(s):
0a5ce48
Update with h2ogpt hash f98f54b58d0c02bd384bb37c7a4bdd8a46b19724
Browse files
app.py
CHANGED
|
@@ -227,8 +227,9 @@ def main(
|
|
| 227 |
score = 0.0
|
| 228 |
clear_torch_cache()
|
| 229 |
except RuntimeError as e:
|
| 230 |
-
if 'Expected all tensors to be on the same device' in str(
|
| 231 |
-
|
|
|
|
| 232 |
print("GPU error: question: %s answer: %s exception: %s" % (prompt, res, str(e)),
|
| 233 |
flush=True)
|
| 234 |
traceback.print_exc()
|
|
@@ -845,7 +846,9 @@ body{background-image:url("https://h2o.ai/content/experience-fragments/h2o/us/en
|
|
| 845 |
clear_torch_cache()
|
| 846 |
return 'Response Score: GPU OOM'
|
| 847 |
except RuntimeError as e:
|
| 848 |
-
if 'Expected all tensors to be on the same device' in str(e) or
|
|
|
|
|
|
|
| 849 |
print("GPU Error: question: %s answer: %s exception: %s" % (question, answer, str(e)), flush=True)
|
| 850 |
traceback.print_exc()
|
| 851 |
clear_torch_cache()
|
|
@@ -1344,8 +1347,9 @@ def evaluate(
|
|
| 1344 |
clear_torch_cache()
|
| 1345 |
return
|
| 1346 |
except RuntimeError as e:
|
| 1347 |
-
if 'Expected all tensors to be on the same device' in str(
|
| 1348 |
-
|
|
|
|
| 1349 |
print(
|
| 1350 |
"GPU Error: prompt: %s inputs_decoded: %s exception: %s" % (prompt, inputs_decoded, str(e)),
|
| 1351 |
flush=True)
|
|
|
|
| 227 |
score = 0.0
|
| 228 |
clear_torch_cache()
|
| 229 |
except RuntimeError as e:
|
| 230 |
+
if 'Expected all tensors to be on the same device' in str(e) or \
|
| 231 |
+
'expected scalar type Half but found Float' in str(e) or \
|
| 232 |
+
'probability tensor contains either' in str(e):
|
| 233 |
print("GPU error: question: %s answer: %s exception: %s" % (prompt, res, str(e)),
|
| 234 |
flush=True)
|
| 235 |
traceback.print_exc()
|
|
|
|
| 846 |
clear_torch_cache()
|
| 847 |
return 'Response Score: GPU OOM'
|
| 848 |
except RuntimeError as e:
|
| 849 |
+
if 'Expected all tensors to be on the same device' in str(e) or \
|
| 850 |
+
'expected scalar type Half but found Float' in str(e) or \
|
| 851 |
+
'probability tensor contains either' in str(e):
|
| 852 |
print("GPU Error: question: %s answer: %s exception: %s" % (question, answer, str(e)), flush=True)
|
| 853 |
traceback.print_exc()
|
| 854 |
clear_torch_cache()
|
|
|
|
| 1347 |
clear_torch_cache()
|
| 1348 |
return
|
| 1349 |
except RuntimeError as e:
|
| 1350 |
+
if 'Expected all tensors to be on the same device' in str(e) or \
|
| 1351 |
+
'expected scalar type Half but found Float' in str(e) or \
|
| 1352 |
+
'probability tensor contains either' in str(e):
|
| 1353 |
print(
|
| 1354 |
"GPU Error: prompt: %s inputs_decoded: %s exception: %s" % (prompt, inputs_decoded, str(e)),
|
| 1355 |
flush=True)
|