Spaces:
Runtime error
Runtime error
Commit
·
e7b447a
1
Parent(s):
0250ee0
Update app.py
Browse files
app.py
CHANGED
|
@@ -76,12 +76,8 @@ def evaluate(
|
|
| 76 |
if '\n\n' in out_str:
|
| 77 |
break
|
| 78 |
|
| 79 |
-
gpu_info = nvmlDeviceGetMemoryInfo(gpu_h)
|
| 80 |
-
print(f'vram {gpu_info.total} used {gpu_info.used} free {gpu_info.free}')
|
| 81 |
del out
|
| 82 |
del state
|
| 83 |
-
gc.collect()
|
| 84 |
-
torch.cuda.empty_cache()
|
| 85 |
yield out_str.strip()
|
| 86 |
|
| 87 |
examples = [
|
|
@@ -222,11 +218,6 @@ def chat(
|
|
| 222 |
out, state = model.forward(tokens, state_pre_1)
|
| 223 |
break
|
| 224 |
|
| 225 |
-
gpu_info = nvmlDeviceGetMemoryInfo(gpu_h)
|
| 226 |
-
print(f'vram {gpu_info.total} used {gpu_info.used} free {gpu_info.free}')
|
| 227 |
-
|
| 228 |
-
gc.collect()
|
| 229 |
-
torch.cuda.empty_cache()
|
| 230 |
|
| 231 |
chatbot[-1][1] = out_str.strip()
|
| 232 |
history = [state, state_pre_0, all_tokens]
|
|
|
|
| 76 |
if '\n\n' in out_str:
|
| 77 |
break
|
| 78 |
|
|
|
|
|
|
|
| 79 |
del out
|
| 80 |
del state
|
|
|
|
|
|
|
| 81 |
yield out_str.strip()
|
| 82 |
|
| 83 |
examples = [
|
|
|
|
| 218 |
out, state = model.forward(tokens, state_pre_1)
|
| 219 |
break
|
| 220 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
|
| 222 |
chatbot[-1][1] = out_str.strip()
|
| 223 |
history = [state, state_pre_0, all_tokens]
|