Spaces:
Runtime error
Runtime error
Small showcase for xformers.
Browse files
app.py
CHANGED
@@ -1,5 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
import platform
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
print(platform.libc_ver())
|
5 |
|
|
|
1 |
import gradio as gr
|
2 |
import platform
|
3 |
+
import torch
|
4 |
+
from xformers import ops
|
5 |
+
|
6 |
+
q = torch.zeros((2, 2, 2, 2)).cuda()
|
7 |
+
k = torch.zeros((2, 2, 2, 2)).cuda()
|
8 |
+
v = torch.zeros((2, 2, 2, 2)).cuda()
|
9 |
+
|
10 |
+
out = ops.memory_efficient_attention(q, k, v)
|
11 |
+
print(out)
|
12 |
|
13 |
print(platform.libc_ver())
|
14 |
|